Restrict the object rooms that can be created

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2023-01-02 16:02:25 +01:00
parent ffd0f2525e
commit 249a34da96
No known key found for this signature in database
GPG key ID: C400AAF20C1BB6FC
2 changed files with 9 additions and 1 deletions

View file

@ -825,6 +825,8 @@ class RoomController extends AEnvironmentAwareController {
} catch (ParticipantNotFoundException $e) {
return new DataResponse(['error' => 'permissions'], Http::STATUS_BAD_REQUEST);
}
} elseif ($objectType !== '') {
return new DataResponse(['error' => 'object'], Http::STATUS_BAD_REQUEST);
}
// Create the room

View file

@ -584,12 +584,18 @@ Feature: conversation/breakout-rooms
| 2 | class room | 0 | 1 | 0 |
| 2 | Room 1 | 1 | 0 | 0 |
| 2 | Room 2 | 1 | 0 | 0 |
# Can not nest
# Can not nest breakout rooms
Given user "participant1" creates room "Room 3" with 400 (v4)
| roomType | 2 |
| roomName | Room 3 |
| objectType | room |
| objectId | ROOM(Room 2) |
# Can not create room for other object types
Given user "participant1" creates room "Room 3" with 400 (v4)
| roomType | 2 |
| roomName | Room 3 |
| objectType | files |
| objectId | ROOM(class room) |
Given user "participant1" creates room "Room 3" with 201 (v4)
| roomType | 2 |
| roomName | Room 3 |