You are here

public function EntityTestPermissions::entityTestBundlePermissions in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/entity_test/src/EntityTestPermissions.php \Drupal\entity_test\EntityTestPermissions::entityTestBundlePermissions()
  2. 10 core/modules/system/tests/modules/entity_test/src/EntityTestPermissions.php \Drupal\entity_test\EntityTestPermissions::entityTestBundlePermissions()

Returns an array of entity_test_bundle permissions.

Return value

array An array of entity_test_bundle permissions. @see \Drupal\user\PermissionHandlerInterface::getPermissions()

1 string reference to 'EntityTestPermissions::entityTestBundlePermissions'
entity_test.permissions.yml in core/modules/system/tests/modules/entity_test/entity_test.permissions.yml
core/modules/system/tests/modules/entity_test/entity_test.permissions.yml

File

core/modules/system/tests/modules/entity_test/src/EntityTestPermissions.php, line 22

Class

EntityTestPermissions
Provides dynamic permissions for entity test.

Namespace

Drupal\entity_test

Code

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

  // Generate permissions for all EntityTestBundle bundles.
  foreach (EntityTestBundle::loadMultiple() as $type) {
    $perms += $this
      ->buildPermissions($type);
  }
  return $perms;
}