diff --git a/frontend/src/components/home/Tree/Groups.tsx b/frontend/src/components/home/Tree/Groups.tsx index 6fd7c4633..2940071fc 100644 --- a/frontend/src/components/home/Tree/Groups.tsx +++ b/frontend/src/components/home/Tree/Groups.tsx @@ -19,6 +19,7 @@ import { PermissionLevel } from "../../../types"; const Groups: Component<{}> = (p) => { const { isSemiMobile } = useAppDimensions(); + const { user, user_id } = useUser(); const { groups } = useAppState(); const [selected, setSelected] = useLocalStorage( null, @@ -49,6 +50,9 @@ const Groups: Component<{}> = (p) => { return undefined; } }); + const canEdit = (group_id: string) => + user().admin || + groups.get(group_id)?.permissions?.[user_id()] === PermissionLevel.Update; return ( @@ -80,7 +84,7 @@ const Groups: Component<{}> = (p) => { containerStyle={{ height: "100%" }} /> }> - +