function WorkspaceAccessControlHandler::checkCreateAccess

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

Overrides EntityAccessControlHandler::checkCreateAccess

File

core/modules/workspaces/src/WorkspaceAccessControlHandler.php, line 52

Class

WorkspaceAccessControlHandler
Defines the access control handler for the workspace entity type.

Namespace

Drupal\workspaces

Code

protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
    return AccessResult::allowedIfHasPermissions($account, [
        'administer workspaces',
        'create workspace',
    ], 'OR');
}

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