|
@@ 254-269 (lines=16) @@
|
| 251 |
|
* |
| 252 |
|
* @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to create a user group |
| 253 |
|
*/ |
| 254 |
|
public function deleteUserGroup(APIUserGroup $userGroup) |
| 255 |
|
{ |
| 256 |
|
$loadedUserGroup = $this->loadUserGroup($userGroup->id); |
| 257 |
|
|
| 258 |
|
$this->repository->beginTransaction(); |
| 259 |
|
try { |
| 260 |
|
//@todo: what happens to sub user groups and users below sub user groups |
| 261 |
|
$affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUserGroup->getVersionInfo()->getContentInfo()); |
| 262 |
|
$this->repository->commit(); |
| 263 |
|
} catch (Exception $e) { |
| 264 |
|
$this->repository->rollback(); |
| 265 |
|
throw $e; |
| 266 |
|
} |
| 267 |
|
|
| 268 |
|
return $affectedLocationIds; |
| 269 |
|
} |
| 270 |
|
|
| 271 |
|
/** |
| 272 |
|
* Moves the user group to another parent. |
|
@@ 721-736 (lines=16) @@
|
| 718 |
|
* |
| 719 |
|
* @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete the user |
| 720 |
|
*/ |
| 721 |
|
public function deleteUser(APIUser $user) |
| 722 |
|
{ |
| 723 |
|
$loadedUser = $this->loadUser($user->id); |
| 724 |
|
|
| 725 |
|
$this->repository->beginTransaction(); |
| 726 |
|
try { |
| 727 |
|
$affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUser->getVersionInfo()->getContentInfo()); |
| 728 |
|
$this->userHandler->delete($loadedUser->id); |
| 729 |
|
$this->repository->commit(); |
| 730 |
|
} catch (Exception $e) { |
| 731 |
|
$this->repository->rollback(); |
| 732 |
|
throw $e; |
| 733 |
|
} |
| 734 |
|
|
| 735 |
|
return $affectedLocationIds; |
| 736 |
|
} |
| 737 |
|
|
| 738 |
|
/** |
| 739 |
|
* Updates a user. |