function user_permission_get_modules

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 3141

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.