Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-10-06 20:24:34 +0300
committerJoas Schilling <coding@schilljs.com>2021-10-07 19:18:32 +0300
commitd53c3d892cd0d78f8d8de5378faf6a0122bf7ed5 (patch)
treed98dcb4c918c6c92ee1b6005cec8dfc9e563b00f /lib/Service
parent31d0d2aed27677f022fe2f595ba8256b6d712281 (diff)
Fix integration tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service')
-rw-r--r--lib/Service/ParticipantService.php9
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) {