only show camera group edit button on live grid to admins (#24622)

The pencil button on the desktop live grid opened the camera group edit dialog for any role, so viewers could change settings and then hit an admin-only error on save. The button now renders only for admins, matching the sidebar and mobile entry points.
This commit is contained in:
Josh Hawkins 2026-10-10 12:24:00 -05:00 committed by GitHub
parent c75f7c3241
commit 9d9de6263e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,6 +32,7 @@ import { Skeleton } from "@/components/ui/skeleton";
import { useResizeObserver } from "@/hooks/resize-observer";
import { isEqual } from "lodash";
import useSWR from "swr";
import { useIsAdmin } from "@/hooks/use-is-admin";
import { isDesktop, isMobile } from "react-device-detect";
import BirdseyeLivePlayer from "@/components/player/BirdseyeLivePlayer";
import LivePlayer from "@/components/player/LivePlayer";
@ -97,6 +98,7 @@ export default function DraggableGridLayout({
}: DraggableGridLayoutProps) {
const { t } = useTranslation(["views/live"]);
const { data: config } = useSWR<FrigateConfig>("config");
const isAdmin = useIsAdmin();
const birdseyeConfig = useMemo(() => config?.birdseye, [config]);
// preferred live modes per camera
@ -723,7 +725,7 @@ export default function DraggableGridLayout({
</Tooltip>
{!isEditMode && (
<>
{!fullscreen && (
{!fullscreen && isAdmin && (
<Tooltip>
<TooltipTrigger asChild>
<div