API admin exemptions and route guard updates (#21094)

* update exempt paths and add missing guard to api endpoints

* admin only frigate+ submission
This commit is contained in:
Josh Hawkins
2025-11-29 07:30:04 -06:00
committed by GitHub
parent 1b57fb15a7
commit 048475e750
11 changed files with 64 additions and 12 deletions
+3 -1
View File
@@ -20,6 +20,7 @@ import { cn } from "@/lib/utils";
import { ASPECT_VERTICAL_LAYOUT, RecordingPlayerError } from "@/types/record";
import { useTranslation } from "react-i18next";
import ObjectTrackOverlay from "@/components/overlay/ObjectTrackOverlay";
import { useIsAdmin } from "@/hooks/use-is-admin";
// Android native hls does not seek correctly
const USE_NATIVE_HLS = false;
@@ -83,6 +84,7 @@ export default function HlsVideoPlayer({
}: HlsVideoPlayerProps) {
const { t } = useTranslation("components/player");
const { data: config } = useSWR<FrigateConfig>("config");
const isAdmin = useIsAdmin();
// for detail stream context in History
const currentTime = currentTimeOverride;
@@ -285,7 +287,7 @@ export default function HlsVideoPlayer({
volume: true,
seek: true,
playbackRate: true,
plusUpload: config?.plus?.enabled == true,
plusUpload: isAdmin && config?.plus?.enabled == true,
fullscreen: supportsFullscreen,
}}
setControlsOpen={setControlsOpen}