You are here

public function Role::getPermissions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role::getPermissions()
  2. 10 core/modules/user/src/Entity/Role.php \Drupal\user\Entity\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 94

Class

Role
Defines the user role entity class.

Namespace

Drupal\user\Entity

Code

public function getPermissions() {
  if ($this
    ->isAdmin()) {
    return [];
  }
  return $this->permissions;
}