You are here

function registration_role_update_8007 in Registration role 8

Assign 'administer registration roles' to roles having 'administer users'

File

./registration_role.install, line 12
Install, update and uninstall functions for the registration role module.

Code

function registration_role_update_8007(&$sandbox) {
  $roles = user_roles(FALSE, 'administer users');
  foreach ($roles as $role) {
    $roleId = $role
      ->id();
    user_role_grant_permissions($roleId, [
      'administer registration roles',
    ]);
  }
}