You are here

private function PermissionsGenerator::getEditPermissions in Entity Construction Kit (ECK) 8

Retrieves the edit permissions for a given entity type.

Parameters

\Drupal\eck\Entity\EckEntityType $entity_type: The entity type.

Return value

array The edit permission.

1 call to PermissionsGenerator::getEditPermissions()
PermissionsGenerator::buildPermissions in src/PermissionsGenerator.php
Builds a standard list of entity permissions for a given type.

File

src/PermissionsGenerator.php, line 93

Class

PermissionsGenerator
Defines dynamic permissions.

Namespace

Drupal\eck

Code

private function getEditPermissions(EckEntityType $entity_type) {
  $permissions = [];
  foreach ([
    'edit',
    'delete',
    'view',
  ] as $op) {
    $permissions = array_merge($permissions, $this
      ->getEditPermission($entity_type, $op, 'any'));
    if ($entity_type
      ->hasAuthorField()) {
      $permissions = array_merge($permissions, $this
        ->getEditPermission($entity_type, $op, 'own'));
    }
  }
  return $permissions;
}