You are here

function workspace_update_8101 in Workspace 8

Allow "administer deployment" roles access to the Toolbar Update button.

File

./workspace.install, line 40
Install, update and uninstall functions for the workspace module.

Code

function workspace_update_8101() {
  if (\Drupal::moduleHandler()
    ->moduleExists('deploy')) {
    $roles = \Drupal::entityTypeManager()
      ->getStorage('user_role')
      ->loadMultiple();
    foreach ($roles as $role) {
      if ($role
        ->hasPermission('administer deployments')) {
        $role
          ->grantPermission('update any workspace from upstream');
        $role
          ->save();
      }
    }
  }
}