grant = true; } public function isGranted(NodeInterface $node, string $layer, string $right): bool { if ($this->layer == $layer && $this->type == $right && $this->checkIfNodeIsReciever($node) && $this->getConditionBoolOrTrue()) { return $this->grant; } return !($this->grant); } private function getConditionBoolOrTrue(): bool { if ($this->hasCondition()) { return $this->condition->getResult()->getBool(); } return true; } private function checkIfNodeIsReciever(NodeInterface $node): bool { return $this->recieverGroup->getAllRecievers()->contains($node); } }