diff options
author | Joas Schilling <coding@schilljs.com> | 2021-10-06 20:24:34 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-10-07 19:18:32 +0300 |
commit | d53c3d892cd0d78f8d8de5378faf6a0122bf7ed5 (patch) | |
tree | d98dcb4c918c6c92ee1b6005cec8dfc9e563b00f /lib/Service | |
parent | 31d0d2aed27677f022fe2f595ba8256b6d712281 (diff) |
Fix integration tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/ParticipantService.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index 18611b9db..8eb594270 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -37,6 +37,7 @@ use OCA\Talk\Events\ParticipantEvent; use OCA\Talk\Events\RemoveParticipantEvent; use OCA\Talk\Events\RemoveUserEvent; use OCA\Talk\Events\RoomEvent; +use OCA\Talk\Exceptions\ForbiddenException; use OCA\Talk\Exceptions\InvalidPasswordException; use OCA\Talk\Exceptions\ParticipantNotFoundException; use OCA\Talk\Exceptions\UnauthorizedException; @@ -139,11 +140,19 @@ class ParticipantService { $this->dispatcher->dispatch(Room::EVENT_AFTER_PARTICIPANT_TYPE_SET, $event); } + /** + * @throws Exception + * @throws ForbiddenException + */ public function updatePermissions(Room $room, Participant $participant, string $method, int $newPermissions): bool { if ($room->getType() === Room::TYPE_ONE_TO_ONE) { return false; } + if ($participant->hasModeratorPermissions()) { + throw new ForbiddenException(); + } + $attendee = $participant->getAttendee(); if ($attendee->getActorType() === Attendee::ACTOR_GROUPS || $attendee->getActorType() === Attendee::ACTOR_CIRCLES) { |