You are here

protected function EntityAccess::createWorkspaceEditPermission in Workspace 8

Derives the edit permission for a specific workspace.

Parameters

\Drupal\multiversion\Entity\WorkspaceInterface $workspace: The workspace from which to derive the permission.

Return value

array A single-item array with the permission to define.

1 call to EntityAccess::createWorkspaceEditPermission()
EntityAccess::workspacePermissions in src/EntityAccess.php
Returns an array of workspace-specific permissions.

File

src/EntityAccess.php, line 228

Class

EntityAccess
Service wrapper for hooks relating to entity access control.

Namespace

Drupal\workspace

Code

protected function createWorkspaceEditPermission(WorkspaceInterface $workspace) {
  $perms['update_workspace_' . $workspace
    ->id()] = [
    'title' => $this
      ->t('Edit the %workspace workspace', [
      '%workspace' => $workspace
        ->label(),
    ]),
    'description' => $this
      ->t('Edit the %workspace workspace itself', [
      '%workspace' => $workspace
        ->label(),
    ]),
  ];
  return $perms;
}