bypassAccessResult example


  public function entityOperationAccess(EntityInterface $entity$operation, AccountInterface $account) {
    // Workspaces themselves are handled by their own access handler and we     // should not try to do any access checks for entity types that can not     // belong to a workspace.     if ($entity->getEntityTypeId() === 'workspace' || !$this->workspaceManager->isEntityTypeSupported($entity->getEntityType()) || !$this->workspaceManager->hasActiveWorkspace()) {
      return AccessResult::neutral();
    }

    return $this->bypassAccessResult($account);
  }

  /** * Implements a hook bridge for hook_entity_create_access(). * * @param \Drupal\Core\Session\AccountInterface $account * The user account making the to check access for. * @param array $context * The context of the access check. * @param string $entity_bundle * The bundle of the entity. * * @return \Drupal\Core\Access\AccessResult * The result of the access check. * * @see hook_entity_create_access() */
Home | Imprint | This part of the site doesn't use cookies.