|
@@ 573-575 (lines=3) @@
|
| 570 |
|
// If they're not an admin, check they are a subadmin of the group in question |
| 571 |
|
$loggedInUser = $this->userSession->getUser(); |
| 572 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 573 |
|
if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) { |
| 574 |
|
throw new OCSException('', 104); |
| 575 |
|
} |
| 576 |
|
|
| 577 |
|
// Add user to group |
| 578 |
|
$group->addUser($targetUser); |
|
@@ 610-612 (lines=3) @@
|
| 607 |
|
|
| 608 |
|
// If they're not an admin, check they are a subadmin of the group in question |
| 609 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 610 |
|
if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) { |
| 611 |
|
throw new OCSException('', 104); |
| 612 |
|
} |
| 613 |
|
|
| 614 |
|
// Check they aren't removing themselves from 'admin' or their 'subadmin; group |
| 615 |
|
if ($targetUser->getUID() === $loggedInUser->getUID()) { |