You are here

public function DomainAccessPermissions::permissions in Domain Access 8

Define permissions.

1 string reference to 'DomainAccessPermissions::permissions'
domain_access.permissions.yml in domain_access/domain_access.permissions.yml
domain_access/domain_access.permissions.yml

File

domain_access/src/DomainAccessPermissions.php, line 18

Class

DomainAccessPermissions
Dynamic permissions class for Domain Access.

Namespace

Drupal\domain_access

Code

public function permissions() {
  $permissions = [
    'assign domain editors' => [
      'title' => $this
        ->t('Assign additional editors to assigned domains'),
      'restrict access' => TRUE,
    ],
    'assign editors to any domain' => [
      'title' => $this
        ->t('Assign additional editors to any domains'),
      'restrict access' => TRUE,
    ],
    'publish to any domain' => [
      'title' => $this
        ->t('Publish to any domain'),
    ],
    'publish to any assigned domain' => [
      'title' => $this
        ->t('Publish content to any assigned domain'),
    ],
    'create domain content' => [
      'title' => $this
        ->t('Create any content on assigned domains'),
    ],
    'edit domain content' => [
      'title' => $this
        ->t('Edit any content on assigned domains'),
    ],
    'delete domain content' => [
      'title' => $this
        ->t('Delete any content on assigned domains'),
    ],
    'view unpublished domain content' => [
      'title' => $this
        ->t('View unpublished content on assigned domains'),
      'restrict access' => TRUE,
    ],
  ];

  // Generate standard node permissions for all applicable node types.
  foreach (NodeType::loadMultiple() as $type) {
    $permissions += $this
      ->nodePermissions($type);
  }
  return $permissions;
}