function ShortcutAccessControlHandler::checkAccess
Same name in other branches
- 9 core/modules/shortcut/src/ShortcutAccessControlHandler.php \Drupal\shortcut\ShortcutAccessControlHandler::checkAccess()
- 10 core/modules/shortcut/src/ShortcutAccessControlHandler.php \Drupal\shortcut\ShortcutAccessControlHandler::checkAccess()
- 11.x core/modules/shortcut/src/ShortcutAccessControlHandler.php \Drupal\shortcut\ShortcutAccessControlHandler::checkAccess()
Overrides EntityAccessControlHandler::checkAccess
File
-
core/
modules/ shortcut/ src/ ShortcutAccessControlHandler.php, line 53
Class
- ShortcutAccessControlHandler
- Defines the access control handler for the shortcut entity type.
Namespace
Drupal\shortcutCode
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
if ($shortcut_set = $this->shortcutSetStorage
->load($entity->bundle())) {
return shortcut_set_edit_access($shortcut_set, $account);
}
// @todo Fix this bizarre code: how can a shortcut exist without a shortcut
// set? The above if-test is unnecessary. See https://www.drupal.org/node/2339903.
return AccessResult::neutral()->addCacheableDependency($entity);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.