🩹(frontend) render the NoAccessView for unprevileged users
Simplify a broken conditional check that allowed users without the required permissions to see the control menu. The `NoAccessView` is now shown to any user who is neither an admin nor the meeting owner.
This commit is contained in:
committed by
aleb_the_flash
parent
13d0d3d801
commit
4acc9cf40d
@@ -5,7 +5,6 @@ import { useRoomId } from '@/features/rooms/livekit/hooks/useRoomId'
|
|||||||
import { useRoomContext } from '@livekit/components-react'
|
import { useRoomContext } from '@livekit/components-react'
|
||||||
import {
|
import {
|
||||||
RecordingMode,
|
RecordingMode,
|
||||||
useHasFeatureWithoutAdminRights,
|
|
||||||
useHumanizeRecordingMaxDuration,
|
useHumanizeRecordingMaxDuration,
|
||||||
useRecordingStatuses,
|
useRecordingStatuses,
|
||||||
} from '@/features/recording'
|
} from '@/features/recording'
|
||||||
@@ -19,7 +18,6 @@ import {
|
|||||||
} from '@/features/notifications'
|
} from '@/features/notifications'
|
||||||
import posthog from 'posthog-js'
|
import posthog from 'posthog-js'
|
||||||
import { useConfig } from '@/api/useConfig'
|
import { useConfig } from '@/api/useConfig'
|
||||||
import { FeatureFlags } from '@/features/analytics/enums'
|
|
||||||
import { NoAccessView } from './NoAccessView'
|
import { NoAccessView } from './NoAccessView'
|
||||||
import { ControlsButton } from './ControlsButton'
|
import { ControlsButton } from './ControlsButton'
|
||||||
import { RowWrapper } from './RowWrapper'
|
import { RowWrapper } from './RowWrapper'
|
||||||
@@ -28,6 +26,7 @@ import { Checkbox } from '@/primitives/Checkbox'
|
|||||||
import { useTranscriptionLanguage } from '@/features/settings'
|
import { useTranscriptionLanguage } from '@/features/settings'
|
||||||
import { useMutateRecording } from '../hooks/useMutateRecording'
|
import { useMutateRecording } from '../hooks/useMutateRecording'
|
||||||
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
|
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
|
||||||
|
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner.ts'
|
||||||
|
|
||||||
export const ScreenRecordingSidePanel = () => {
|
export const ScreenRecordingSidePanel = () => {
|
||||||
const { data } = useConfig()
|
const { data } = useConfig()
|
||||||
@@ -38,10 +37,7 @@ export const ScreenRecordingSidePanel = () => {
|
|||||||
|
|
||||||
const [includeTranscript, setIncludeTranscript] = useState(false)
|
const [includeTranscript, setIncludeTranscript] = useState(false)
|
||||||
|
|
||||||
const hasFeatureWithoutAdminRights = useHasFeatureWithoutAdminRights(
|
const isAdminOrOwner = useIsAdminOrOwner()
|
||||||
RecordingMode.ScreenRecording,
|
|
||||||
FeatureFlags.ScreenRecording
|
|
||||||
)
|
|
||||||
|
|
||||||
const { notifyParticipants } = useNotifyParticipants()
|
const { notifyParticipants } = useNotifyParticipants()
|
||||||
const { selectedLanguageKey, isLanguageSetToAuto } =
|
const { selectedLanguageKey, isLanguageSetToAuto } =
|
||||||
@@ -108,7 +104,7 @@ export const ScreenRecordingSidePanel = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasFeatureWithoutAdminRights) {
|
if (!isAdminOrOwner) {
|
||||||
return (
|
return (
|
||||||
<NoAccessView
|
<NoAccessView
|
||||||
i18nKeyPrefix={keyPrefix}
|
i18nKeyPrefix={keyPrefix}
|
||||||
|
|||||||
Reference in New Issue
Block a user