feat: Backend reports default permissions.

When any of the backend is used 'anonymous', 'jitsi-anonymous', 'internal_hashed', 'internal_plain', 'cyrus' and a participant becomes a moderator, because of external module or because set from jicofo we send to client with the self-presence about becoming moderator a default set of permissions which can be controlled via prosody config.
If using 'token' authentication the above applies only if there is a token and the token does not contain context.features.
This commit is contained in:
damencho
2025-03-26 13:18:30 -05:00
committed by Дамян Минков
parent b97798e1ca
commit 92df4bfbbb
19 changed files with 219 additions and 102 deletions

View File

@@ -27,14 +27,12 @@ export function isAudioMuteButtonDisabled(state: IReduxState) {
* This function is stateless as it returns a new array and may cause re-rendering.
*
* @param {boolean} isTranscribing - Whether there is currently a transcriber in the meeting.
* @param {boolean} isModerator - Whether local participant is moderator.
* @param {string | undefined} jwt - The jwt token.
* @param {ILocalParticipant} localParticipantFeatures - The features of the local participant.
* @returns {string[]} - The disabled by jwt buttons array.
*/
export function getJwtDisabledButtons(
isTranscribing: boolean,
isModerator: boolean,
jwt: string | undefined,
localParticipantFeatures?: IParticipantFeatures) {
const acc = [];
@@ -43,7 +41,6 @@ export function getJwtDisabledButtons(
jwt,
localParticipantFeatures,
feature: 'livestreaming',
ifNoToken: isModerator,
ifNotInFeatures: false
})) {
acc.push('livestreaming');
@@ -53,7 +50,6 @@ export function getJwtDisabledButtons(
jwt,
localParticipantFeatures,
feature: 'transcription',
ifNoToken: isModerator,
ifNotInFeatures: false
})) {
acc.push('closedcaptions');