|
@@ 556-558 (lines=3) @@
|
| 553 |
|
// If they're not an admin, check they are a subadmin of the group in question |
| 554 |
|
$loggedInUser = $this->userSession->getUser(); |
| 555 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 556 |
|
if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) { |
| 557 |
|
throw new OCSException('', 104); |
| 558 |
|
} |
| 559 |
|
|
| 560 |
|
// Add user to group |
| 561 |
|
$group->addUser($targetUser); |
|
@@ 593-595 (lines=3) @@
|
| 590 |
|
|
| 591 |
|
// If they're not an admin, check they are a subadmin of the group in question |
| 592 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 593 |
|
if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) { |
| 594 |
|
throw new OCSException('', 104); |
| 595 |
|
} |
| 596 |
|
|
| 597 |
|
// Check they aren't removing themselves from 'admin' or their 'subadmin; group |
| 598 |
|
if ($targetUser->getUID() === $loggedInUser->getUID()) { |