Skip to content

Commit

Permalink
fix: Fix adding or removing permissions without call permissions set
Browse files Browse the repository at this point in the history
When adding or removing call permissions the default room permissions
should be taken as a base if no call permission is set. Otherwise adding
will cause the permissions to be set instead of added, while removing
them will have no effect.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
  • Loading branch information
danxuliu committed Aug 17, 2024
1 parent 1111bd3 commit 7d8ea65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Service/RoomService.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ public function setPermissions(Room $room, string $level, string $method, int $p
} elseif ($level === 'call') {
$property = ARoomModifiedEvent::PROPERTY_CALL_PERMISSIONS;
$oldPermissions = $room->getCallPermissions();

if ($oldPermissions === Attendee::PERMISSIONS_DEFAULT
&& ($method === Attendee::PERMISSIONS_MODIFY_ADD
|| $method === Attendee::PERMISSIONS_MODIFY_REMOVE)) {
$oldPermissions = $room->getDefaultPermissions();
}
} else {
return false;
}
Expand Down

0 comments on commit 7d8ea65

Please sign in to comment.