Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/participant.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@

## Set permissions for an attendee

Setting custom permissions for a self-joined user will also make them a permanent user to the conversation.

* Method: `PUT`
* Endpoint: `/room/{token}/attendees/permissions`
* Data:
Expand Down
3 changes: 3 additions & 0 deletions lib/Service/ParticipantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ public function updatePermissions(Room $room, Participant $participant, string $
$this->dispatcher->dispatch(Room::EVENT_BEFORE_PARTICIPANT_PERMISSIONS_SET, $event);

$attendee->setPermissions($newPermissions);
if ($attendee->getParticipantType() === Participant::USER_SELF_JOINED) {
$attendee->setParticipantType(Participant::USER);
}
$this->attendeeMapper->update($attendee);

$this->dispatcher->dispatch(Room::EVENT_AFTER_PARTICIPANT_PERMISSIONS_SET, $event);
Expand Down
17 changes: 15 additions & 2 deletions tests/integration/features/conversation-2/set-permissions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ Feature: conversation-2/set-publishing-permissions
| users | owner | SJLAVPM |
| users | invited user | SJAVPM |



Scenario: setting call permissions resets participant permissions
Given user "owner" creates room "group room" (v4)
| roomType | 2 |
Expand Down Expand Up @@ -136,3 +134,18 @@ Feature: conversation-2/set-publishing-permissions
| actorType | actorId | permissions | attendeePermissions |
| users | owner | SJLAVPM | D |
| users | invited user | CV | D |

Scenario: setting permissions for a self joined user adds them permanently
Given user "owner" creates room "room" (v4)
| roomType | 3 |
| roomName | room |
And user "invited user" joins room "room" with 200 (v4)
And user "owner" sees the following attendees in room "room" with 200 (v4)
| actorType | actorId | permissions | attendeePermissions | participantType |
| users | owner | SJLAVPM | D | 1 |
| users | invited user | SJAVPM | D | 5 |
And user "owner" sets permissions for "invited user" in room "room" to "LAVPM" with 200 (v4)
And user "owner" sees the following attendees in room "room" with 200 (v4)
| actorType | actorId | permissions | attendeePermissions | participantType |
| users | owner | SJLAVPM | D | 1 |
| users | invited user | CLAVPM | CLAVPM | 3 |