Prevent toggling guests or the lobby directly

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2023-01-03 12:06:13 +01:00
parent 5d63a47b7d
commit 95f22e96de
No known key found for this signature in database
GPG key ID: C400AAF20C1BB6FC
3 changed files with 37 additions and 0 deletions

View file

@ -1740,6 +1740,11 @@ class RoomController extends AEnvironmentAwareController {
}
}
if ($this->room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) {
// Do not allow manual changing the lobby in breakout rooms
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
if (!$this->roomService->setLobby($this->room, $state, $timerDateTime)) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}

View file

@ -435,6 +435,14 @@ class RoomService {
return false;
}
if ($room->getBreakoutRoomMode() !== BreakoutRoom::MODE_NOT_CONFIGURED) {
return false;
}
if ($room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) {
return false;
}
$oldType = $room->getType();
$event = new ModifyRoomEvent($room, 'type', $newType, $oldType);
@ -517,6 +525,10 @@ class RoomService {
return false;
}
if ($room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) {
return false;
}
if (!in_array($newState, [
Room::LISTABLE_NONE,
Room::LISTABLE_USERS,

View file

@ -791,3 +791,23 @@ Feature: conversation/breakout-rooms
| type | name |
| 2 | class room |
| 2 | Room 2 |
Scenario: Can not change lobby status, allow or disallow guests in breakout rooms directly
Given user "participant1" creates room "class room" (v4)
| roomType | 2 |
| roomName | class room |
And user "participant1" sees the following attendees in room "class room" with 200 (v4)
| actorType | actorId | participantType |
| users | participant1 | 1 |
And user "participant1" creates 2 automatic breakout rooms for "class room" with 200 (v1)
And user "participant1" is participant of the following rooms (v4)
| type | name | lobbyState | breakoutRoomMode | breakoutRoomStatus |
| 2 | class room | 0 | 1 | 0 |
| 2 | Room 1 | 1 | 0 | 0 |
| 2 | Room 2 | 1 | 0 | 0 |
# Can not disable lobby
Then user "participant1" sets lobby state for room "Room 1" to "no lobby" with 400 (v4)
# Can not enable listing
And user "participant1" allows listing room "Room 1" for "all" with 400 (v4)
# Can not allow guests
And user "participant1" makes room "Room 1" public with 400 (v4)