From d8ecc1a9cc5c33af7337416cd3b83862e25e3743 Mon Sep 17 00:00:00 2001 From: ibs0d <53568938+ibs0d@users.noreply.github.com> Date: Thu, 19 Mar 2026 20:05:46 +1100 Subject: [PATCH] Revert "feat: add personal camera groups with per-user visibility" --- frigate/api/app.py | 12 ---- frigate/config/camera_group.py | 7 +- .../components/filter/CameraGroupSelector.tsx | 67 +------------------ web/src/types/frigateConfig.ts | 1 - 4 files changed, 2 insertions(+), 85 deletions(-) diff --git a/frigate/api/app.py b/frigate/api/app.py index 32843e81f..4c0d3ead2 100644 --- a/frigate/api/app.py +++ b/frigate/api/app.py @@ -171,18 +171,6 @@ def config(request: Request): config["go2rtc"]["streams"][stream_name] = cleaned - # filter camera_groups by current user - username = request.headers.get("remote-user") - role = request.headers.get("remote-role") - - if username and role and role != "admin": - filtered_groups = {} - for group_name, group_config in config.get("camera_groups", {}).items(): - group_users = group_config.get("users") - if not group_users or username in group_users: - filtered_groups[group_name] = group_config - config["camera_groups"] = filtered_groups - config["plus"] = {"enabled": request.app.frigate_config.plus_api.is_active()} config["model"]["colormap"] = config_obj.model.colormap config["model"]["all_attributes"] = config_obj.model.all_attributes diff --git a/frigate/config/camera_group.py b/frigate/config/camera_group.py index b69182806..65319001a 100644 --- a/frigate/config/camera_group.py +++ b/frigate/config/camera_group.py @@ -1,4 +1,4 @@ -from typing import Optional, Union +from typing import Union from pydantic import Field, field_validator @@ -23,11 +23,6 @@ class CameraGroupConfig(FrigateBaseModel): title="Sort order", description="Numeric order used to sort camera groups in the UI; larger numbers appear later.", ) - users: Optional[list[str]] = Field( - default=None, - title="Allowed users", - description="List of usernames who can see this group. If not set or empty, the group is visible to all users.", - ) @field_validator("cameras", mode="before") @classmethod diff --git a/web/src/components/filter/CameraGroupSelector.tsx b/web/src/components/filter/CameraGroupSelector.tsx index 862b5e9cf..6d86c57f8 100644 --- a/web/src/components/filter/CameraGroupSelector.tsx +++ b/web/src/components/filter/CameraGroupSelector.tsx @@ -679,11 +679,6 @@ export function CameraGroupEdit({ const allowedCameras = useAllowedCameras(); const isAdmin = useIsAdmin(); - // fetch users list for the users multi-select (admin only) - const { data: usersList } = useSWR<{ username: string; role: string }[]>( - isAdmin ? "users" : null, - ); - const [openCamera, setOpenCamera] = useState(); const birdseyeConfig = useMemo(() => config?.birdseye, [config]); @@ -726,7 +721,6 @@ export function CameraGroupEdit({ .refine((value) => Object.keys(LuIcons).includes(value), { message: "Invalid icon", }), - users: z.array(z.string()).optional(), }); const onSubmit = useCallback( @@ -762,18 +756,10 @@ export function CameraGroupEdit({ const cameraQueries = values.cameras .map((cam) => `&camera_groups.${values.name}.cameras=${cam}`) .join(""); - const usersQueries = - values.users && values.users.length > 0 - ? values.users - .map( - (user) => `&camera_groups.${values.name}.users=${user}`, - ) - .join("") - : ""; axios .put( - `config/set?${renamingQuery}${orderQuery}&${iconQuery}${cameraQueries}${usersQueries}`, + `config/set?${renamingQuery}${orderQuery}&${iconQuery}${cameraQueries}`, { requires_restart: 0, }, @@ -842,7 +828,6 @@ export function CameraGroupEdit({ name: (editingGroup && editingGroup[0]) ?? "", icon: editingGroup && (editingGroup[1].icon as IconName), cameras: editingGroup && editingGroup[1].cameras, - users: (editingGroup && editingGroup[1].users) ?? [], }, }); @@ -985,56 +970,6 @@ export function CameraGroupEdit({ )} /> - {isAdmin && usersList && usersList.length > 0 && ( - <> - - ( - - {t("group.users.label", { defaultValue: "Assigned Users" })} - - {t("group.users.desc", { defaultValue: "If no users are selected, the group is visible to all users." })} - - -
- {usersList.map((user) => ( - -
- - { - const updatedUsers = checked - ? [...(field.value || []), user.username] - : (field.value || []).filter( - (u) => u !== user.username, - ); - form.setValue("users", updatedUsers); - }} - /> -
-
- ))} -
-
- )} - /> - - )} -
diff --git a/web/src/types/frigateConfig.ts b/web/src/types/frigateConfig.ts index 20ab93a58..e3f794602 100644 --- a/web/src/types/frigateConfig.ts +++ b/web/src/types/frigateConfig.ts @@ -312,7 +312,6 @@ export type CameraGroupConfig = { cameras: string[]; icon: IconName; order: number; - users?: string[]; }; export type StreamType = "no-streaming" | "smart" | "continuous";