You are here

public function DeployPermissions::workspacePointerPermissions in Deploy - Content Staging 8

Generates the permissions for workspace pointer entities.

Return value

array The permissions for workspace pointer entities.

1 string reference to 'DeployPermissions::workspacePointerPermissions'
deploy.permissions.yml in ./deploy.permissions.yml
deploy.permissions.yml

File

src/DeployPermissions.php, line 20

Class

DeployPermissions
Defines permissions for Deploy module.

Namespace

Drupal\deploy

Code

public function workspacePointerPermissions() {
  $permissions = [];
  $workspace_pointers = WorkspacePointer::loadMultiple();
  foreach ($workspace_pointers as $workspace_pointer) {
    $permissions['Deploy to ' . $workspace_pointer
      ->label()] = [
      'title' => $this
        ->t('Deploy to @workspace_pointer', [
        '@workspace_pointer' => $workspace_pointer
          ->label(),
      ]),
    ];
  }
  return $permissions;
}