You are here

public function EntityAccess::entityAccess in Workspace 8

Hook bridge.

Parameters

\Drupal\Core\Entity\EntityInterface $entity:

string $operation:

\Drupal\Core\Session\AccountInterface $account:

Return value

\Drupal\Core\Access\AccessResult

See also

hook_entity_access()

File

src/EntityAccess.php, line 63

Class

EntityAccess
Service wrapper for hooks relating to entity access control.

Namespace

Drupal\workspace

Code

public function entityAccess(EntityInterface $entity, $operation, AccountInterface $account) {

  // Workspaces themselves are handled by another hook. Ignore them here.
  if ($entity
    ->getEntityTypeId() == 'workspace') {
    return AccessResult::neutral();
  }
  return $this
    ->bypassAccessResult($account);
}