Skip to content

Conversation

@danxuliu
Copy link
Member

Even if call permissions will be removed in Talk 21 right now they are available through the API, so they should to be fixed. Moreover, technically adding and removing permissions could be done too with room permissions, even if right now the API only allows that with call permissions (which on the other hand could be a hint to also remove adding/removing permissions and just allow setting them).

For the details please refer to the integration tests and the description in each individual commit.

When adding permissions to all attendees the permissions are added to
the call/room and to the attendees. Attendees with default permissions
will get the effective permissions from the call/room permissions, so
the permissions should be added only to those attendees that already
have custom permissions.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
When adding or removing attendee permissions the permissions are
decomposed in each separate permission and added or removed
individually. However, the same query object was reused, so once it was
executed for the first permission found then it no longer worked as
expected for the following permissions.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
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 <[email protected]>
@danxuliu
Copy link
Member Author

/backport to stable30

@danxuliu
Copy link
Member Author

/backport to stable29

@danxuliu
Copy link
Member Author

/backport to stable28

@nickvergessen
Copy link
Member

which on the other hand could be a hint to also remove adding/removing permissions and just allow setting them

Yeah, that was my next plan. Also since there is no client/UI allowing that atm (or is the lobby bypass using that?)

@danxuliu
Copy link
Member Author

danxuliu commented Aug 19, 2024

which on the other hand could be a hint to also remove adding/removing permissions and just allow setting them

Yeah, that was my next plan. Also since there is no client/UI allowing that atm (or is the lobby bypass using that?)

It does (although for specific participants, not for the whole room):

async setLobbyPermission(value) {
try {
await this.$store.dispatch('setPermissions', {
token: this.token,
attendeeId: this.attendeeId,
method: value ? 'add' : 'remove',
permissions: PARTICIPANT.PERMISSIONS.LOBBY_IGNORE,
})

$result = $this->participantService->updatePermissions($this->room, $targetParticipant, $method, $permissions);

@danxuliu danxuliu closed this Aug 19, 2024
@danxuliu danxuliu reopened this Aug 19, 2024
@danxuliu
Copy link
Member Author

Double click 🤦

Attendee::PERMISSIONS_LOBBY_IGNORE,
] as $permission) {
if ($permission & $newState) {
$query = $this->getModifyPermissionsBaseQuery($roomId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be outside the loop? We don't need to create the query builder 7 times?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The query builder would be created as many times as individual permissions are added/removed, so it would be created seven times only if the seven permissions were added/removed at once.

A single query object needs to be created for each individual permission because adding or removing a single permission executes the statement. Is there any way to reset the query builder to reuse the same base update query and change the set and andWhere parts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants