function EntityTestAccessControlHandler::checkCreateAccess

Same name in other branches
  1. 9 core/modules/system/tests/modules/entity_test/src/EntityTestAccessControlHandler.php \Drupal\entity_test\EntityTestAccessControlHandler::checkCreateAccess()
  2. 8.9.x core/modules/system/tests/modules/entity_test/src/EntityTestAccessControlHandler.php \Drupal\entity_test\EntityTestAccessControlHandler::checkCreateAccess()
  3. 11.x core/modules/system/tests/modules/entity_test/src/EntityTestAccessControlHandler.php \Drupal\entity_test\EntityTestAccessControlHandler::checkCreateAccess()

Overrides EntityAccessControlHandler::checkCreateAccess

File

core/modules/system/tests/modules/entity_test/src/EntityTestAccessControlHandler.php, line 95

Class

EntityTestAccessControlHandler
Defines the access control handler for the test entity type.

Namespace

Drupal\entity_test

Code

protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
    return AccessResult::allowedIfHasPermissions($account, [
        'administer entity_test content',
        'administer entity_test_with_bundle content',
        'create ' . $entity_bundle . ' entity_test_with_bundle entities',
    ], 'OR');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.