Conditions | 6 |
Paths | 8 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
36 | public function execute($user, $item, $params) |
||
37 | { |
||
38 | $class = Yii::$app->user->identityClass; |
||
39 | if (is_numeric($user) || is_int($user)) { |
||
40 | $user = $class::find()->id($user)->one(); |
||
41 | } |
||
42 | if (is_string($user)) { |
||
43 | $user = $class::find()->guid($user)->one(); |
||
44 | } |
||
45 | $organization = $params['organization']; |
||
46 | /* @var $organization Organization */// The Organization or department to be decided. |
||
47 | // If current user is creator of organization or department, he is allowed to manage it's profile. |
||
48 | if ($user->isOrganizationCreator($organization)|| $user->isOrganizationAdministrator($organization)) { |
||
49 | return true; |
||
50 | } |
||
51 | return false; |
||
52 | } |
||
53 | } |
||
54 |