revert: add restriction callback to restrict visibility and modification of widget kinds (#2746)

This reverts commit 84f73d33a0.
This commit is contained in:
Meier Lukas
2025-03-29 12:43:10 +01:00
parent d1b14aca8b
commit 98515312a2
16 changed files with 253 additions and 292 deletions

View File

@@ -3,8 +3,6 @@ import { ActionIcon, Menu } from "@mantine/core";
import { IconCopy, IconDotsVertical, IconLayoutKanban, IconPencil, IconTrash } from "@tabler/icons-react";
import { clientApi } from "@homarr/api/client";
import { useSession } from "@homarr/auth/client";
import { isWidgetRestricted } from "@homarr/auth/shared";
import { useEditMode } from "@homarr/boards/edit-mode";
import { useConfirmModal, useModalAction } from "@homarr/modals";
import { useSettings } from "@homarr/settings";
@@ -39,7 +37,6 @@ export const BoardItemMenu = ({
const currentDefinition = useMemo(() => widgetImports[item.kind].definition, [item.kind]);
const { gridstack } = useSectionContext().refs;
const settings = useSettings();
const { data: session } = useSession();
// Reset error boundary on next render if item has been edited
useEffect(() => {
@@ -94,16 +91,6 @@ export const BoardItemMenu = ({
});
};
if (
isWidgetRestricted({
definition: currentDefinition,
user: session?.user ?? null,
check: (level) => level !== "none",
})
) {
return null;
}
return (
<Menu withinPortal withArrow position="right-start" arrowPosition="center">
<Menu.Target>