function ShortcutSetAccessControlHandler::checkCreateAccess

Same name in other branches
  1. 8.9.x core/modules/shortcut/src/ShortcutSetAccessControlHandler.php \Drupal\shortcut\ShortcutSetAccessControlHandler::checkCreateAccess()
  2. 10 core/modules/shortcut/src/ShortcutSetAccessControlHandler.php \Drupal\shortcut\ShortcutSetAccessControlHandler::checkCreateAccess()
  3. 11.x core/modules/shortcut/src/ShortcutSetAccessControlHandler.php \Drupal\shortcut\ShortcutSetAccessControlHandler::checkCreateAccess()

Overrides EntityAccessControlHandler::checkCreateAccess

File

core/modules/shortcut/src/ShortcutSetAccessControlHandler.php, line 46

Class

ShortcutSetAccessControlHandler
Defines the access control handler for the shortcut set entity type.

Namespace

Drupal\shortcut

Code

protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
    return AccessResult::allowedIfHasPermission($account, 'administer shortcuts')->orIf(AccessResult::allowedIfHasPermissions($account, [
        'access shortcuts',
        'customize shortcut links',
    ], 'AND'));
}

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