|
@@ 329-331 (lines=3) @@
|
| 326 |
|
|
| 327 |
|
// If not permitted |
| 328 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 329 |
|
if(!$this->groupManager->isAdmin($currentLoggedInUser->getUID()) && !$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) { |
| 330 |
|
throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); |
| 331 |
|
} |
| 332 |
|
|
| 333 |
|
// Go ahead with the delete |
| 334 |
|
if($targetUser->delete()) { |
|
@@ 378-380 (lines=3) @@
|
| 375 |
|
|
| 376 |
|
// If not permitted |
| 377 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 378 |
|
if(!$this->groupManager->isAdmin($currentLoggedInUser->getUID()) && !$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) { |
| 379 |
|
throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); |
| 380 |
|
} |
| 381 |
|
|
| 382 |
|
// enable/disable the user now |
| 383 |
|
$targetUser->setEnabled($value); |