| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 3.072 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 5 | public function execute($user, $item, $params) |
|
| 35 | { |
||
| 36 | 5 | $organization = $params['organization']; |
|
| 37 | /* @var $organization Organization */// The Organization or department which is parent. |
||
| 38 | // If current user is creator of organization or department, he is allowed to set up a child. |
||
| 39 | 5 | if ($user->isOrganizationCreator($organization)|| $user->isOrganizationAdministrator($organization)) { |
|
| 40 | 5 | return true; |
|
| 41 | } |
||
| 42 | return false; |
||
| 43 | } |
||
| 44 | } |
||
| 45 |