public function RoleSectionStorage::getPotentialRoles in Workbench Access 8
Gets a list of potential roles.
Parameters
string $id: The section id.
Return value
array An array of roles keyed by rid with name values.
Overrides RoleSectionStorageInterface::getPotentialRoles
File
- src/
RoleSectionStorage.php, line 125
Class
- RoleSectionStorage
- Defines a role-section storage that uses the State API.
Namespace
Drupal\workbench_accessCode
public function getPotentialRoles($id) {
$list = [];
$roles = $this->roleStorage
->loadMultiple();
foreach ($roles as $rid => $role) {
$list[$rid] = $role
->label();
}
return $list;
}