function _user_role_permissions_update
Same name in other branches
- 9 core/modules/user/user.module \_user_role_permissions_update()
- 8.9.x core/modules/user/user.module \_user_role_permissions_update()
Determine the permissions for one or more roles during update.
A separate version is needed because during update the entity system can't be used and in non-update situations the entity system is preferred because of the hook system.
Parameters
array $roles: An array of role IDs.
Return value
array An array indexed by role ID. Each value is an array of permission strings for the given role.
Deprecated
in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement.
See also
https://www.drupal.org/node/3348138
1 call to _user_role_permissions_update()
- user_role_permissions in core/
modules/ user/ user.module - Determine the permissions for one or more roles.
File
-
core/
modules/ user/ user.module, line 270
Code
function _user_role_permissions_update($roles) {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3348138', E_USER_DEPRECATED);
$role_permissions = [];
foreach ($roles as $rid) {
$role_permissions[$rid] = \Drupal::config("user.role.{$rid}")->get('permissions') ?: [];
}
return $role_permissions;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.