Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | public function execute($user, $item, $params) |
||
35 | { |
||
36 | $organization = $params['organization']; |
||
37 | /* @var $organization Organization */// The department to be revoked. |
||
38 | // If current user is creator of department, he is allowed to revoke it. |
||
39 | if ($user->isOrganizationCreator($organization)) { |
||
40 | return true; |
||
41 | } |
||
42 | // If current user is creator or administrator of parent one, he is allowed to revoke it. |
||
43 | $parent = $organization->parent; |
||
44 | if ($user->isOrganizationCreator($parent) || $user->isOrganizationAdministrator($parent)) { |
||
45 | return false; |
||
46 | } |
||
47 | return false; |
||
48 | } |
||
49 | } |
||
50 |