function BlockTypeAccessControlHandler::checkAccess
Same name in other branches
- 10 core/modules/block_content/src/BlockTypeAccessControlHandler.php \Drupal\block_content\BlockTypeAccessControlHandler::checkAccess()
Overrides EntityAccessControlHandler::checkAccess
File
-
core/
modules/ block_content/ src/ BlockTypeAccessControlHandler.php, line 25
Class
- BlockTypeAccessControlHandler
- Defines the access control handler for the "Block Type" entity type.
Namespace
Drupal\block_contentCode
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
if ($operation === 'view label') {
return AccessResult::allowedIfHasPermission($account, 'access block library')->orIf(parent::checkAccess($entity, $operation, $account));
}
return parent::checkAccess($entity, $operation, $account);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.