Skip to content

Commit 35863ec

Browse files
committed
🩹(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.
1 parent 3d125e9 commit 35863ec

8 files changed

Lines changed: 97 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to
2222
- 🐛(summary) support webm #1290
2323
- ⬆️(backend) bump django-lasuite to v0.0.26
2424
- 🩹(frontend) use a more standard (quality) rating scale
25+
- 🩹(frontend) fix access control for screen recording feature flag
2526

2627
## [1.14.0] - 2026-04-16
2728

src/frontend/src/features/recording/components/NoAccessView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface NoAccessViewProps {
2121
imagePath: string
2222
handleRequest: () => Promise<void>
2323
isActive: boolean
24+
isAdminOrOwner?: boolean
2425
}
2526

2627
export const NoAccessView = ({
@@ -30,6 +31,7 @@ export const NoAccessView = ({
3031
imagePath,
3132
handleRequest,
3233
isActive,
34+
isAdminOrOwner = false,
3335
}: NoAccessViewProps) => {
3436
const { isLoggedIn } = useUser()
3537
const { t } = useTranslation('rooms', { keyPrefix: i18nKeyPrefix })
@@ -105,7 +107,7 @@ export const NoAccessView = ({
105107
{!isLoggedIn && !isActive && (
106108
<Divider label={t(`${i18nKey}.dividerLabel`)} />
107109
)}
108-
{!isActive && (
110+
{!isActive && !isAdminOrOwner && (
109111
<RequestRecording
110112
heading={t(`${i18nKey}.request.heading`)}
111113
body={t(`${i18nKey}.request.body`)}

src/frontend/src/features/recording/components/ScreenRecordingSidePanel.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useRoomId } from '@/features/rooms/livekit/hooks/useRoomId'
55
import { useRoomContext } from '@livekit/components-react'
66
import {
77
RecordingMode,
8+
useHasRecordingAccess,
89
useHumanizeRecordingMaxDuration,
910
useRecordingStatuses,
1011
} from '@/features/recording'
@@ -26,7 +27,8 @@ import { Checkbox } from '@/primitives/Checkbox'
2627
import { useTranscriptionLanguage } from '@/features/settings'
2728
import { useMutateRecording } from '../hooks/useMutateRecording'
2829
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
29-
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner.ts'
30+
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
31+
import { FeatureFlags } from '@/features/analytics/enums'
3032

3133
export const ScreenRecordingSidePanel = () => {
3234
const { data } = useConfig()
@@ -39,6 +41,11 @@ export const ScreenRecordingSidePanel = () => {
3941

4042
const isAdminOrOwner = useIsAdminOrOwner()
4143

44+
const hasScreenRecordingAccess = useHasRecordingAccess(
45+
RecordingMode.ScreenRecording,
46+
FeatureFlags.ScreenRecording
47+
)
48+
4249
const { notifyParticipants } = useNotifyParticipants()
4350
const { selectedLanguageKey, isLanguageSetToAuto } =
4451
useTranscriptionLanguage()
@@ -117,6 +124,19 @@ export const ScreenRecordingSidePanel = () => {
117124
)
118125
}
119126

127+
if (!hasScreenRecordingAccess) {
128+
return (
129+
<NoAccessView
130+
i18nKeyPrefix={keyPrefix}
131+
i18nKey="premium"
132+
imagePath="/assets/intro-slider/3.png"
133+
isActive={statuses.isActive}
134+
handleRequest={handleRequestScreenRecording}
135+
isAdminOrOwner={isAdminOrOwner}
136+
/>
137+
)
138+
}
139+
120140
return (
121141
<Div
122142
display="flex"

src/frontend/src/features/recording/components/TranscriptSidePanel.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { RowWrapper } from './RowWrapper'
3434
import { useMutateRecording } from '../hooks/useMutateRecording'
3535
import { useIsMetadataCollectorEnabled } from '../hooks/useMetadataCollectorEnabled'
3636
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
37+
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
3738

3839
export const TranscriptSidePanel = () => {
3940
const { data } = useConfig()
@@ -60,6 +61,8 @@ export const TranscriptSidePanel = () => {
6061
FeatureFlags.Transcript
6162
)
6263

64+
const isAdminOrOwner = useIsAdminOrOwner()
65+
6366
const isMetadataCollectorEnabled = useIsMetadataCollectorEnabled()
6467

6568
const roomId = useRoomId()
@@ -153,6 +156,7 @@ export const TranscriptSidePanel = () => {
153156
imagePath="/assets/intro-slider/3.png"
154157
handleRequest={handleRequestTranscription}
155158
isActive={statuses.isActive}
159+
isAdminOrOwner={isAdminOrOwner}
156160
/>
157161
)
158162
}

src/frontend/src/locales/de/rooms.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@
416416
},
417417
"premium": {
418418
"heading": "Premium-Funktion",
419-
"body": "Diese Funktion ist öffentlichen Bediensteten vorbehalten. Wenn deine E-Mail-Adresse nicht autorisiert ist, kontaktiere bitte den Support, um Zugriff zu erhalten.",
419+
"body": "Diese Funktion ist für Sie nicht verfügbar. Bitte wenden Sie sich an den Support, um weitere Informationen zu erhalten.",
420420
"linkMore": "Dokumentation öffnen",
421421
"linkAriaLabel": "Dokumentation zum Premium-Zugang öffnen – öffnet in neuem Tab",
422422
"dividerLabel": "ODER",
@@ -467,6 +467,22 @@
467467
"buttonLabel": "Anfrage senden"
468468
}
469469
},
470+
"premium": {
471+
"heading": "Premium-Funktion",
472+
"body": "Diese Funktion ist für Sie nicht verfügbar. Bitte wenden Sie sich an den Support, um weitere Informationen zu erhalten.",
473+
"linkMore": "Dokumentation öffnen",
474+
"linkAriaLabel": "Dokumentation zum Premium-Zugang öffnen – öffnet in neuem Tab",
475+
"dividerLabel": "ODER",
476+
"login": {
477+
"heading": "Anmeldung erforderlich",
478+
"body": "Nur die*der Ersteller:in bzw. Admin kann die Aufzeichnung starten. Melde dich an, um deine Berechtigungen zu überprüfen."
479+
},
480+
"request": {
481+
"heading": "Aufnahme anfragen",
482+
"body": "Die Moderation wird benachrichtigt und kann die Aufnahme starten.",
483+
"buttonLabel": "Anfrage senden"
484+
}
485+
},
470486
"durationMessage": "(begrenzt auf {{max_duration}})"
471487
},
472488
"errorRecordingAlertDialog": {

src/frontend/src/locales/en/rooms.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
},
416416
"premium": {
417417
"heading": "Premium feature",
418-
"body": "This feature is reserved for public agents. If your email address is not authorized, please contact support to get access.",
418+
"body": "This feature is not available to you. Please contact support for more information.",
419419
"linkMore": "Open documentation",
420420
"linkAriaLabel": "Open documentation about premium access - opens in new window",
421421
"dividerLabel": "OR",
@@ -466,6 +466,22 @@
466466
"buttonLabel": "Request"
467467
}
468468
},
469+
"premium": {
470+
"heading": "Premium feature",
471+
"body": "This feature is not available to you. Please contact support for more information.",
472+
"linkMore": "Open documentation",
473+
"linkAriaLabel": "Open documentation about premium access - opens in new window",
474+
"dividerLabel": "OR",
475+
"login": {
476+
"heading": "You are not logged in!",
477+
"body": "You must be logged in to use this feature. Please log in, then try again."
478+
},
479+
"request": {
480+
"heading": "Request Recording",
481+
"body": "The host will be notified and can enable recording for you.",
482+
"buttonLabel": "Request"
483+
}
484+
},
469485
"durationMessage": "(limited to {{max_duration}}) "
470486
},
471487
"errorRecordingAlertDialog": {

src/frontend/src/locales/fr/rooms.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
},
416416
"premium": {
417417
"heading": "Fonctionnalité premium",
418-
"body": "Cette fonctionnalité est réservée aux agents publics. Si votre adresse email n’est pas autorisée, contactez le support pour obtenir l'accès.",
418+
"body": "Cette fonctionnalité ne vous est pas ouverte. Contactez le support pour obtenir plus d'informations.",
419419
"linkMore": "Ouvrir la documentation",
420420
"dividerLabel": "OU",
421421
"login": {
@@ -466,6 +466,22 @@
466466
"buttonLabel": "Demander"
467467
}
468468
},
469+
"premium": {
470+
"heading": "Fonctionnalité premium",
471+
"body": "Cette fonctionnalité ne vous est pas ouverte. Contactez le support pour obtenir plus d'informations.",
472+
"linkMore": "Ouvrir la documentation",
473+
"dividerLabel": "OU",
474+
"login": {
475+
"heading": "Vous n'êtes pas connecté !",
476+
"body": "Vous devez être connecté pour utiliser cette fonctionnalité. Connectez-vous, puis réessayez."
477+
},
478+
"request": {
479+
"heading": "Demander à l'organisateur",
480+
"body": "L'hôte recevra une notification et pourra démarrer l'enregistrement pour vous.",
481+
"buttonLabel": "Demander"
482+
},
483+
"linkAriaLabel": "Ouvrir la documentation sur l'accès premium - ouvre dans une nouvelle fenêtre"
484+
},
469485
"durationMessage": "(limité à {{max_duration}}) "
470486
},
471487
"errorRecordingAlertDialog": {

src/frontend/src/locales/nl/rooms.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
},
416416
"premium": {
417417
"heading": "Premiumfunctie",
418-
"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.",
418+
"body": "Deze functie is niet voor u beschikbaar. Neem contact op met de ondersteuning voor meer informatie.",
419419
"linkMore": "Documentatie openen",
420420
"linkAriaLabel": "Documentatie over premiumtoegang openen - opent in nieuw venster",
421421
"dividerLabel": "OF",
@@ -466,6 +466,22 @@
466466
"buttonLabel": "Aanvragen"
467467
}
468468
},
469+
"premium": {
470+
"heading": "Premiumfunctie",
471+
"body": "Deze functie is niet voor u beschikbaar. Neem contact op met de ondersteuning voor meer informatie.",
472+
"linkMore": "Documentatie openen",
473+
"linkAriaLabel": "Documentatie over premiumtoegang openen - opent in nieuw venster",
474+
"dividerLabel": "OF",
475+
"login": {
476+
"heading": "Inloggen vereist",
477+
"body": "Alleen de maker van de vergadering of een beheerder kan de opname starten. Log in om uw machtigingen te controleren."
478+
},
479+
"request": {
480+
"heading": "Opname aanvragen",
481+
"body": "De host wordt op de hoogte gebracht en kan de opname voor u inschakelen.",
482+
"buttonLabel": "Aanvragen"
483+
}
484+
},
469485
"durationMessage": "(beperkt tot {{max_duration}})"
470486
},
471487
"errorRecordingAlertDialog": {

0 commit comments

Comments
 (0)