function _user_role_permissions_update

_user_role_permissions_update($roles)

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.

File

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

Code

function _user_role_permissions_update($roles) {
  $role_permissions = array();
  foreach ($roles as $rid) {
    $role_permissions[$rid] = \Drupal::config("user.role.$rid")->get('permissions') ? : array();
  }
  return $role_permissions;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!user!user.module/function/_user_role_permissions_update/8.1.x