You are here

function site_settings_post_update_update_permissions in Site Settings and Labels 8

Implements hook_post_update_NAME().

Add the 'access site settings overview' permission for roles that have the 'edit site setting entities' permission.

File

./site_settings.post_update.php, line 16
Post update functions for Site Settings.

Code

function site_settings_post_update_update_permissions() {
  foreach (Role::loadMultiple() as $role) {
    if ($role
      ->hasPermission('edit site setting entities')) {
      $role
        ->grantPermission('access site settings overview')
        ->save();
    }
  }
}