Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Role.php

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 288

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());
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal