public function Role8::getModulePerms

8.0.x Role8.php public Role8::getModulePerms($module)
7.x Role8.php public Role8::getModulePerms($module)
master Role8.php public Role8::getModulePerms($module)

Overrides Role7::getModulePerms

File

lib/Drush/Role/Role8.php, line 39

Namespace

Drush\Role

Class

Role8

Code

public function getModulePerms($module) {
  $module_perms = array();
  $perms = \Drupal::service('user.permissions')->getPermissions();
  foreach ($perms as $name => $perm) {
    if ($perm['provider'] == $module) {
      $module_perms[] = $name;
    }
  }
  return $module_perms;
}