@@ 60-69 (lines=10) @@ | ||
57 | * |
|
58 | * @return bool |
|
59 | */ |
|
60 | public function assign(array $items): bool |
|
61 | { |
|
62 | foreach ($items as $name) { |
|
63 | $item = $this->manager->getRole($name); |
|
64 | $item = $item ?: $this->manager->getPermission($name); |
|
65 | $this->manager->assign($item, $this->userId); |
|
66 | } |
|
67 | ||
68 | return true; |
|
69 | } |
|
70 | ||
71 | /** |
|
72 | * Revokes a roles and permissions from the user. |
|
@@ 78-87 (lines=10) @@ | ||
75 | * |
|
76 | * @return bool |
|
77 | */ |
|
78 | public function revoke(array $items): bool |
|
79 | { |
|
80 | foreach ($items as $name) { |
|
81 | $item = $this->manager->getRole($name); |
|
82 | $item = $item ?: $this->manager->getPermission($name); |
|
83 | $this->manager->revoke($item, $this->userId); |
|
84 | } |
|
85 | ||
86 | return true; |
|
87 | } |
|
88 | ||
89 | /** |
|
90 | * Get all available and assigned roles and permissions |