function redirect_update_8107 in Redirect 8
Update permissions.
When splitting the permission for settings from the permission to view the list of redirects, maintain the current permissions for sites which already have this module installed.
File
- ./
redirect.install, line 205 - Update hooks for the Redirect module.
Code
function redirect_update_8107() {
if ($roles = Role::loadMultiple()) {
foreach ($roles as $role) {
if ($role
->hasPermission('administer redirects')) {
$role
->grantPermission('administer redirect settings');
$role
->save();
}
}
}
}