You are here

function user_permission_get_modules in Drupal 7

Determine the modules that permissions belong to.

Return value

An associative array in the format $permission => $module.

1 call to user_permission_get_modules()
user_role_grant_permissions in modules/user/user.module
Grant permissions to a user role.

File

modules/user/user.module, line 3121
Enables the user registration and login system.

Code

function user_permission_get_modules() {
  $permissions = array();
  foreach (module_implements('permission') as $module) {
    $perms = module_invoke($module, 'permission');
    foreach ($perms as $key => $value) {
      $permissions[$key] = $module;
    }
  }
  return $permissions;
}