|
@@ 624-626 (lines=3) @@
|
| 621 |
|
// If they're not an admin, check they are a subadmin of the group in question |
| 622 |
|
$loggedInUser = $this->userSession->getUser(); |
| 623 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 624 |
|
if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) { |
| 625 |
|
throw new OCSException('', 104); |
| 626 |
|
} |
| 627 |
|
|
| 628 |
|
// Add user to group |
| 629 |
|
$group->addUser($targetUser); |
|
@@ 661-663 (lines=3) @@
|
| 658 |
|
|
| 659 |
|
// If they're not an admin, check they are a subadmin of the group in question |
| 660 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 661 |
|
if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) { |
| 662 |
|
throw new OCSException('', 104); |
| 663 |
|
} |
| 664 |
|
|
| 665 |
|
// Check they aren't removing themselves from 'admin' or their 'subadmin; group |
| 666 |
|
if ($targetUser->getUID() === $loggedInUser->getUID()) { |