|
@@ 468-470 (lines=3) @@
|
| 465 |
|
// If they're not an admin, check they are a subadmin of the group in question |
| 466 |
|
$loggedInUser = $this->userSession->getUser(); |
| 467 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 468 |
|
if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) { |
| 469 |
|
throw new OCSException('', 104); |
| 470 |
|
} |
| 471 |
|
|
| 472 |
|
// Add user to group |
| 473 |
|
$group->addUser($targetUser); |
|
@@ 505-507 (lines=3) @@
|
| 502 |
|
|
| 503 |
|
// If they're not an admin, check they are a subadmin of the group in question |
| 504 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 505 |
|
if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) { |
| 506 |
|
throw new OCSException('', 104); |
| 507 |
|
} |
| 508 |
|
|
| 509 |
|
// Check they aren't removing themselves from 'admin' or their 'subadmin; group |
| 510 |
|
if ($userId === $loggedInUser->getUID()) { |