Skip to content

Commit 22a9459

Browse files
author
Marcin Stodulski
committed
added getters&setters for trees
1 parent 7a09416 commit 22a9459

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/interfaces/RoleInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ interface RoleInterface
1414
{
1515
public function getParent(): ?RoleInterface;
1616
public function getCode(): string;
17-
public function getPermissions(): array;
17+
public function getPermissions();
1818
public function isHasAllPermissions(): bool;
1919
}

src/services/Authorization.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ public function getPermissionsTree(): array
7474
return $this->permissionsTree;
7575
}
7676

77+
public function setRolesTree(array $rolesTree): void
78+
{
79+
$this->rolesTree = $rolesTree;
80+
}
81+
82+
public function getRolesTree(): array
83+
{
84+
return $this->rolesTree;
85+
}
86+
7787
public function getAllSubRolesAndPermissionsForRole(RoleInterface $role): array
7888
{
7989
$rolesArray = [$role->getCode()];

0 commit comments

Comments
 (0)