function Role::getAllValidPermissions

Returns all valid permissions.

@internal @todo Revisit in https://www.drupal.org/node/3446364

Return value

string[] All possible valid permissions.

See also

\Drupal\user\PermissionHandler::getPermissions()

File

core/modules/user/src/Entity/Role.php, line 278

Class

Role
Defines the user role entity class.

Namespace

Drupal\user\Entity

Code

public static function getAllValidPermissions() : array {
    return array_keys(\Drupal::service('user.permissions')->getPermissions());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.