🩹(frontend) fix access control for screen recording feature flag

Ensure screen recording is properly disabled when the feature
flag is set to false.

Previously, no feature flag was enforced, allowing unintended
access.

Also update the blocked-access message to be more generic and not
specific to public sector users.
This commit is contained in:
lebaudantoine
2026-04-30 00:33:43 +02:00
committed by aleb_the_flash
parent 3d125e940f
commit 35863ec3b6
8 changed files with 97 additions and 6 deletions
+1
View File
@@ -22,6 +22,7 @@ and this project adheres to
- 🐛(summary) support webm #1290
- ⬆️(backend) bump django-lasuite to v0.0.26
- 🩹(frontend) use a more standard (quality) rating scale
- 🩹(frontend) fix access control for screen recording feature flag
## [1.14.0] - 2026-04-16
@@ -21,6 +21,7 @@ interface NoAccessViewProps {
imagePath: string
handleRequest: () => Promise<void>
isActive: boolean
isAdminOrOwner?: boolean
}
export const NoAccessView = ({
@@ -30,6 +31,7 @@ export const NoAccessView = ({
imagePath,
handleRequest,
isActive,
isAdminOrOwner = false,
}: NoAccessViewProps) => {
const { isLoggedIn } = useUser()
const { t } = useTranslation('rooms', { keyPrefix: i18nKeyPrefix })
@@ -105,7 +107,7 @@ export const NoAccessView = ({
{!isLoggedIn && !isActive && (
<Divider label={t(`${i18nKey}.dividerLabel`)} />
)}
{!isActive && (
{!isActive && !isAdminOrOwner && (
<RequestRecording
heading={t(`${i18nKey}.request.heading`)}
body={t(`${i18nKey}.request.body`)}
@@ -5,6 +5,7 @@ import { useRoomId } from '@/features/rooms/livekit/hooks/useRoomId'
import { useRoomContext } from '@livekit/components-react'
import {
RecordingMode,
useHasRecordingAccess,
useHumanizeRecordingMaxDuration,
useRecordingStatuses,
} from '@/features/recording'
@@ -26,7 +27,8 @@ import { Checkbox } from '@/primitives/Checkbox'
import { useTranscriptionLanguage } from '@/features/settings'
import { useMutateRecording } from '../hooks/useMutateRecording'
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner.ts'
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
import { FeatureFlags } from '@/features/analytics/enums'
export const ScreenRecordingSidePanel = () => {
const { data } = useConfig()
@@ -39,6 +41,11 @@ export const ScreenRecordingSidePanel = () => {
const isAdminOrOwner = useIsAdminOrOwner()
const hasScreenRecordingAccess = useHasRecordingAccess(
RecordingMode.ScreenRecording,
FeatureFlags.ScreenRecording
)
const { notifyParticipants } = useNotifyParticipants()
const { selectedLanguageKey, isLanguageSetToAuto } =
useTranscriptionLanguage()
@@ -117,6 +124,19 @@ export const ScreenRecordingSidePanel = () => {
)
}
if (!hasScreenRecordingAccess) {
return (
<NoAccessView
i18nKeyPrefix={keyPrefix}
i18nKey="premium"
imagePath="/assets/intro-slider/3.png"
isActive={statuses.isActive}
handleRequest={handleRequestScreenRecording}
isAdminOrOwner={isAdminOrOwner}
/>
)
}
return (
<Div
display="flex"
@@ -34,6 +34,7 @@ import { RowWrapper } from './RowWrapper'
import { useMutateRecording } from '../hooks/useMutateRecording'
import { useIsMetadataCollectorEnabled } from '../hooks/useMetadataCollectorEnabled'
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
export const TranscriptSidePanel = () => {
const { data } = useConfig()
@@ -60,6 +61,8 @@ export const TranscriptSidePanel = () => {
FeatureFlags.Transcript
)
const isAdminOrOwner = useIsAdminOrOwner()
const isMetadataCollectorEnabled = useIsMetadataCollectorEnabled()
const roomId = useRoomId()
@@ -153,6 +156,7 @@ export const TranscriptSidePanel = () => {
imagePath="/assets/intro-slider/3.png"
handleRequest={handleRequestTranscription}
isActive={statuses.isActive}
isAdminOrOwner={isAdminOrOwner}
/>
)
}
+17 -1
View File
@@ -416,7 +416,7 @@
},
"premium": {
"heading": "Premium-Funktion",
"body": "Diese Funktion ist öffentlichen Bediensteten vorbehalten. Wenn deine E-Mail-Adresse nicht autorisiert ist, kontaktiere bitte den Support, um Zugriff zu erhalten.",
"body": "Diese Funktion ist für Sie nicht verfügbar. Bitte wenden Sie sich an den Support, um weitere Informationen zu erhalten.",
"linkMore": "Dokumentation öffnen",
"linkAriaLabel": "Dokumentation zum Premium-Zugang öffnen öffnet in neuem Tab",
"dividerLabel": "ODER",
@@ -467,6 +467,22 @@
"buttonLabel": "Anfrage senden"
}
},
"premium": {
"heading": "Premium-Funktion",
"body": "Diese Funktion ist für Sie nicht verfügbar. Bitte wenden Sie sich an den Support, um weitere Informationen zu erhalten.",
"linkMore": "Dokumentation öffnen",
"linkAriaLabel": "Dokumentation zum Premium-Zugang öffnen öffnet in neuem Tab",
"dividerLabel": "ODER",
"login": {
"heading": "Anmeldung erforderlich",
"body": "Nur die*der Ersteller:in bzw. Admin kann die Aufzeichnung starten. Melde dich an, um deine Berechtigungen zu überprüfen."
},
"request": {
"heading": "Aufnahme anfragen",
"body": "Die Moderation wird benachrichtigt und kann die Aufnahme starten.",
"buttonLabel": "Anfrage senden"
}
},
"durationMessage": "(begrenzt auf {{max_duration}})"
},
"errorRecordingAlertDialog": {
+17 -1
View File
@@ -415,7 +415,7 @@
},
"premium": {
"heading": "Premium feature",
"body": "This feature is reserved for public agents. If your email address is not authorized, please contact support to get access.",
"body": "This feature is not available to you. Please contact support for more information.",
"linkMore": "Open documentation",
"linkAriaLabel": "Open documentation about premium access - opens in new window",
"dividerLabel": "OR",
@@ -466,6 +466,22 @@
"buttonLabel": "Request"
}
},
"premium": {
"heading": "Premium feature",
"body": "This feature is not available to you. Please contact support for more information.",
"linkMore": "Open documentation",
"linkAriaLabel": "Open documentation about premium access - opens in new window",
"dividerLabel": "OR",
"login": {
"heading": "You are not logged in!",
"body": "You must be logged in to use this feature. Please log in, then try again."
},
"request": {
"heading": "Request Recording",
"body": "The host will be notified and can enable recording for you.",
"buttonLabel": "Request"
}
},
"durationMessage": "(limited to {{max_duration}}) "
},
"errorRecordingAlertDialog": {
+17 -1
View File
@@ -415,7 +415,7 @@
},
"premium": {
"heading": "Fonctionnalité premium",
"body": "Cette fonctionnalité est réservée aux agents publics. Si votre adresse email nest pas autorisée, contactez le support pour obtenir l'accès.",
"body": "Cette fonctionnalité ne vous est pas ouverte. Contactez le support pour obtenir plus d'informations.",
"linkMore": "Ouvrir la documentation",
"dividerLabel": "OU",
"login": {
@@ -466,6 +466,22 @@
"buttonLabel": "Demander"
}
},
"premium": {
"heading": "Fonctionnalité premium",
"body": "Cette fonctionnalité ne vous est pas ouverte. Contactez le support pour obtenir plus d'informations.",
"linkMore": "Ouvrir la documentation",
"dividerLabel": "OU",
"login": {
"heading": "Vous n'êtes pas connecté !",
"body": "Vous devez être connecté pour utiliser cette fonctionnalité. Connectez-vous, puis réessayez."
},
"request": {
"heading": "Demander à l'organisateur",
"body": "L'hôte recevra une notification et pourra démarrer l'enregistrement pour vous.",
"buttonLabel": "Demander"
},
"linkAriaLabel": "Ouvrir la documentation sur l'accès premium - ouvre dans une nouvelle fenêtre"
},
"durationMessage": "(limité à {{max_duration}}) "
},
"errorRecordingAlertDialog": {
+17 -1
View File
@@ -415,7 +415,7 @@
},
"premium": {
"heading": "Premiumfunctie",
"body": "Deze functie is voorbehouden aan openbare medewerkers. Als uw e-mailadres niet is toegestaan, neem dan contact op met de support om toegang te krijgen.",
"body": "Deze functie is niet voor u beschikbaar. Neem contact op met de ondersteuning voor meer informatie.",
"linkMore": "Documentatie openen",
"linkAriaLabel": "Documentatie over premiumtoegang openen - opent in nieuw venster",
"dividerLabel": "OF",
@@ -466,6 +466,22 @@
"buttonLabel": "Aanvragen"
}
},
"premium": {
"heading": "Premiumfunctie",
"body": "Deze functie is niet voor u beschikbaar. Neem contact op met de ondersteuning voor meer informatie.",
"linkMore": "Documentatie openen",
"linkAriaLabel": "Documentatie over premiumtoegang openen - opent in nieuw venster",
"dividerLabel": "OF",
"login": {
"heading": "Inloggen vereist",
"body": "Alleen de maker van de vergadering of een beheerder kan de opname starten. Log in om uw machtigingen te controleren."
},
"request": {
"heading": "Opname aanvragen",
"body": "De host wordt op de hoogte gebracht en kan de opname voor u inschakelen.",
"buttonLabel": "Aanvragen"
}
},
"durationMessage": "(beperkt tot {{max_duration}})"
},
"errorRecordingAlertDialog": {