Role::postLoad

public static Role::postLoad(EntityStorageInterface $storage, array &$entities) Acts on loaded entities. Parameters \Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object. \Drupal\Core\Entity\EntityInterface[] $entities: An array of entities. Overrides Entity::postLoad File core/modules/user/src/Entity/Role.php, line 161 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code public static function postLoad(EntityStorageInterface $s

Role::isAdmin

public Role::isAdmin() Indicates that a role has all available permissions. Return value bool TRUE if the role has all permissions. Overrides RoleInterface::isAdmin File core/modules/user/src/Entity/Role.php, line 146 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code public function isAdmin() { return (bool) $this->is_admin; }

Role::hasPermission

public Role::hasPermission($permission) Checks if the role has a permission. Parameters string $permission: The permission to check for. Return value bool TRUE if the role has the permission, FALSE if not. Overrides RoleInterface::hasPermission File core/modules/user/src/Entity/Role.php, line 112 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code public function hasPermission($permission) { if ($this->isAdmin()) { return TRUE; } return in_ar

Role::grantPermission

public Role::grantPermission($permission) Grant permissions to the role. Parameters string $permission: The permission to grant. Return value $this Overrides RoleInterface::grantPermission File core/modules/user/src/Entity/Role.php, line 122 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code public function grantPermission($permission) { if ($this->isAdmin()) { return $this; } if (!$this->hasPermission($permission)) { $this->permis

Role::getWeight

public Role::getWeight() Returns the weight. Return value int The weight of this role. Overrides RoleInterface::getWeight File core/modules/user/src/Entity/Role.php, line 97 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code public function getWeight() { return $this->get('weight'); }

Role::getPermissions

public Role::getPermissions() Returns a list of permissions assigned to the role. Return value array The permissions assigned to the role. Overrides RoleInterface::getPermissions File core/modules/user/src/Entity/Role.php, line 87 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code public function getPermissions() { if ($this->isAdmin()) { return []; } return $this->permissions; }

Role::$weight

The weight of this role in administrative listings. Type: int File core/modules/user/src/Entity/Role.php, line 68 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code protected $weight;

Role::$permissions

The permissions belonging to this role. Type: array File core/modules/user/src/Entity/Role.php, line 75 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code protected $permissions = array();

Role::$label

The human-readable label of this role. Type: string File core/modules/user/src/Entity/Role.php, line 61 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code protected $label;

Role::$is_admin

An indicator whether the role has all permissions. Type: bool File core/modules/user/src/Entity/Role.php, line 82 Class Role Defines the user role entity class. Namespace Drupal\user\Entity Code protected $is_admin;