You are here

public function PermissionsGenerator::entityPermissions in Entity Construction Kit (ECK) 8

Returns an array of entity type permissions.

Return value

array The permissions.

1 string reference to 'PermissionsGenerator::entityPermissions'
eck.permissions.yml in ./eck.permissions.yml
eck.permissions.yml

File

src/PermissionsGenerator.php, line 23

Class

PermissionsGenerator
Defines dynamic permissions.

Namespace

Drupal\eck

Code

public function entityPermissions() {
  $perms = [];

  // Generate entity permissions for all entity types.
  foreach (EckEntityType::loadMultiple() as $eck_type) {
    $perms = array_merge($perms, $this
      ->buildPermissions($eck_type));
  }
  return $perms;
}