1 user.module | user_modules_installed($modules) |
Implements hook_modules_installed().
File
- core/
modules/ user/ user.module, line 3388 - Enables the user registration and login system.
Code
function user_modules_installed($modules) {
// Assign all available permissions to the administrator role.
$role_name = config_get('system.core', 'user_admin_role');
$role = user_role_load($role_name);
if ($role) {
$permissions = array();
foreach ($modules as $module) {
if ($module_permissions = module_invoke($module, 'permission')) {
$permissions = array_merge($permissions, array_keys($module_permissions));
}
}
if (!empty($permissions)) {
user_role_grant_permissions($role_name, $permissions);
}
}
}