function BundlePermissionHandlerTraitTest::buildPermissions
Same name in other branches
- 10 core/tests/Drupal/KernelTests/Core/Entity/BundlePermissionHandlerTraitTest.php \Drupal\KernelTests\Core\Entity\BundlePermissionHandlerTraitTest::buildPermissions()
- 11.x core/tests/Drupal/KernelTests/Core/Entity/BundlePermissionHandlerTraitTest.php \Drupal\KernelTests\Core\Entity\BundlePermissionHandlerTraitTest::buildPermissions()
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ BundlePermissionHandlerTraitTest.php, line 67
Class
- BundlePermissionHandlerTraitTest
- @coversDefaultClass \Drupal\Core\Entity\BundlePermissionHandlerTrait
Namespace
Drupal\KernelTests\Core\EntityCode
protected function buildPermissions(EntityInterface $bundle) : array {
return [
"create {$bundle->id()}" => [
'title' => 'Create',
],
"edit {$bundle->id()}" => [
'title' => 'Edit',
// Ensure it is possible for buildPermissions to add additional
// dependencies.
'dependencies' => [
'config' => [
"test_module.entity.{$bundle->id()}",
],
'module' => [
'test_module',
],
],
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.