1.20.x user.module user_permission_get_modules()

Determine the modules that permissions belong to.

Return value

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

File

modules/user/user.module, line 2599
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;
}