diff --git a/src/Entity/PageAccess.php b/src/Entity/PageAccess.php index a4a23f4..c0e79b8 100644 --- a/src/Entity/PageAccess.php +++ b/src/Entity/PageAccess.php @@ -79,15 +79,16 @@ class PageAccess extends EntityAccessControlHandler implements EntityHandlerInte $conditions = $entity->getAccessConditions(); foreach ($conditions as $condition) { if ($condition instanceof ContextAwarePluginInterface) { - try { - $this->contextHandler()->applyContextMapping($condition, $contexts); - } - catch (ContextException $e) { - return parent::checkAccess($entity, $operation, $account); - } - $this->contextHandler()->applyContextMapping($condition, $contexts); - } else { - return parent::checkAccess($entity, $operation, $account); + try { + $this->contextHandler()->applyContextMapping($condition, $contexts); + } + catch (ContextException $e) { + return parent::checkAccess($entity, $operation, $account); + } + $this->contextHandler()->applyContextMapping($condition, $contexts); + } + else { + return parent::checkAccess($entity, $operation, $account); } } return AccessResult::allowedIf($this->resolveConditions($conditions, $entity->getAccessLogic()));