initAllRights(); } private function initAllRights(): void { $this->rights = new ArrayCollection(); } public function isGranted(NodeInterface $node, string $layer, string $right): bool { /* * * @var RightInterface */ foreach ($this->rights->toArray() as $right) { if ($right->isGranted($node, $layer, $right)) { return true; } } return false; } }