You are here

public function DelegatableRoles::getAllRoles in Role Delegation 8

Gets all roles apart from anonymous and authenticated.

Return value

\Drupal\user\RoleInterface[] An array of role objects.

Overrides DelegatableRolesInterface::getAllRoles

1 call to DelegatableRoles::getAllRoles()
DelegatableRoles::getAssignableRoles in src/DelegatableRoles.php
Gets the roles a user is allowed to assing.

File

src/DelegatableRoles.php, line 42

Class

DelegatableRoles
Class DelegatableRoles.

Namespace

Drupal\role_delegation

Code

public function getAllRoles() {
  $all_roles = Role::loadMultiple();
  unset($all_roles[RoleInterface::ANONYMOUS_ID], $all_roles[RoleInterface::AUTHENTICATED_ID]);
  return $all_roles;
}