Conditions | 5 |
Paths | 8 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
32 | public function init(AuthManager $auth) |
||
33 | { |
||
34 | foreach (array_keys($this->getTree()) as $role) { |
||
35 | $auth->setRole($role); |
||
36 | } |
||
37 | |||
38 | foreach ($this->getTree() as $role => $items) { |
||
39 | foreach ($items as $name) { |
||
40 | $item = $auth->getItem($name); |
||
41 | if ($item === null) { |
||
42 | $item = $auth->setPermission($name); |
||
43 | $auth->setPermission("deny:$name"); |
||
44 | } |
||
45 | $auth->setChild($role, $item); |
||
46 | } |
||
59 |