|
@@ 382-384 (lines=3) @@
|
| 379 |
|
|
| 380 |
|
// If not permitted |
| 381 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 382 |
|
if(!$this->groupManager->isAdmin($currentLoggedInUser->getUID()) && !$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) { |
| 383 |
|
throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); |
| 384 |
|
} |
| 385 |
|
|
| 386 |
|
// Go ahead with the delete |
| 387 |
|
if($targetUser->delete()) { |
|
@@ 437-439 (lines=3) @@
|
| 434 |
|
|
| 435 |
|
// If not permitted |
| 436 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 437 |
|
if(!$this->groupManager->isAdmin($currentLoggedInUser->getUID()) && !$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) { |
| 438 |
|
throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); |
| 439 |
|
} |
| 440 |
|
|
| 441 |
|
// enable/disable the user now |
| 442 |
|
$targetUser->setEnabled($value); |