Implemented Reciever

This commit is contained in:
Kevin Frantz
2018-09-14 00:18:21 +02:00
parent 8a5efb2e1f
commit 043c8d45b7
10 changed files with 107 additions and 5 deletions

View File

@@ -42,5 +42,19 @@ class Node extends AbstractEntity implements NodeInterface
{
$this->law = new Law();
$this->law->setNode($this);
$this->initPermissions();
}
private function initPermissions(): void
{
/*
* @var RightInterface
*/
foreach ($this->law->getRights()->toArray() as $right) {
$permission = new Permission();
$permission->setNode($this);
$permission->setRight($right);
$right->addPermission($permission);
}
}
}