You are here

public function Masquerade::getPermissions in Masquerade 8.2

Returns module provided permissions.

Return value

array Array of permission names.

File

src/Masquerade.php, line 205

Class

Masquerade
Defines a masquerade service to switch user account.

Namespace

Drupal\masquerade

Code

public function getPermissions() {
  $permissions = [];
  foreach ($this->permissionHandler
    ->getPermissions() as $name => $permission) {
    if ($permission['provider'] === 'masquerade') {

      // Filter only module's permissions.
      $permissions[] = $name;
    }
  }
  return $permissions;
}