You are here

public function Security::permissions in Security Review 8

Gets all the permissions.

Parameters

bool $meta: Whether to return only permission strings or metadata too.

Return value

array Array of every permission.

See also

\Drupal\user\PermissionHandlerInterface::getPermissions()

1 call to Security::permissions()
Security::rolePermissions in src/Security.php
Returns the permission strings that a group of roles have.

File

src/Security.php, line 222

Class

Security
Provides frequently used security-related data.

Namespace

Drupal\security_review

Code

public function permissions($meta = FALSE) {

  // Not injected because of hard testability.
  $permissions = \Drupal::service('user.permissions')
    ->getPermissions();
  if (!$meta) {
    return array_keys($permissions);
  }
  return $permissions;
}