You are here

private function DomainEntityPermissions::bundlePermissions in Domain Access Entity 8

Helper method to generate bundle permission list.

Parameters

int $id: Bundle ID.

string $label: Bundle label.

int $entityTypeId: Entity type ID.

string $entityTypeLabel: Entity type label.

Return value

array An array of permission names and descriptions.

See also

DomainAccessPermissions

1 call to DomainEntityPermissions::bundlePermissions()
DomainEntityPermissions::permissions in src/DomainEntityPermissions.php
Define permissions.

File

src/DomainEntityPermissions.php, line 52

Class

DomainEntityPermissions
Dynamic permissions class for Domain Entity.

Namespace

Drupal\domain_entity

Code

private function bundlePermissions($id, $label, $entityTypeId, $entityTypeLabel) {

  // Build standard list of bundle permissions for this type.
  $perms = [
    "create {$id} {$entityTypeId} content on assigned domains" => [
      'title' => $this
        ->t('%entity_type_name: %type_name: Create new content on assigned domains', [
        '%type_name' => $label,
        '%entity_type_name' => $entityTypeLabel,
      ]),
    ],
    "update {$id} {$entityTypeId} content on assigned domains" => [
      'title' => $this
        ->t('%entity_type_name: %type_name: Edit any content on assigned domains', [
        '%type_name' => $label,
        '%entity_type_name' => $entityTypeLabel,
      ]),
    ],
    "delete {$id} {$entityTypeId} content on assigned domains" => [
      'title' => $this
        ->t('%entity_type_name: %type_name: Delete any content on assigned domains', [
        '%type_name' => $label,
        '%entity_type_name' => $entityTypeLabel,
      ]),
    ],
  ];
  return $perms;
}