diff --git a/apps/client/src/ee/page-permission/components/general-access-select.tsx b/apps/client/src/ee/page-permission/components/general-access-select.tsx
index de2f78af..5b039c74 100644
--- a/apps/client/src/ee/page-permission/components/general-access-select.tsx
+++ b/apps/client/src/ee/page-permission/components/general-access-select.tsx
@@ -2,7 +2,7 @@ import { Group, Menu, Text, UnstyledButton } from "@mantine/core";
import {
IconChevronDown,
IconLock,
- IconWorld,
+ IconShieldLock,
IconCheck,
} from "@tabler/icons-react";
import { useTranslation } from "react-i18next";
@@ -14,75 +14,75 @@ type GeneralAccessSelectProps = {
value: AccessLevel;
onChange: (value: AccessLevel) => void;
disabled?: boolean;
- isInherited?: boolean;
+ hasInheritedRestriction?: boolean;
};
export function GeneralAccessSelect({
value,
onChange,
disabled,
- isInherited,
+ hasInheritedRestriction,
}: GeneralAccessSelectProps) {
const { t } = useTranslation();
- const isRestricted = value === "restricted";
+ const isDirectlyRestricted = value === "restricted";
+ const showInheritedState = hasInheritedRestriction && !isDirectlyRestricted;
+
+ const currentLabel = showInheritedState
+ ? t("Restricted by parent")
+ : isDirectlyRestricted
+ ? t("Restricted")
+ : t("Open");
+
+ const currentDescription = showInheritedState
+ ? t("Inherits restrictions from ancestor page")
+ : isDirectlyRestricted
+ ? t("Only specific people can access")
+ : t("Everyone in this space can access");
+
+ const CurrentIcon = showInheritedState
+ ? IconShieldLock
+ : isDirectlyRestricted
+ ? IconLock
+ : IconShieldLock;
const accessOptions = [
{
value: "open" as const,
- label: t("Open"),
- description: t("Everyone in this space can access"),
- icon: IconWorld,
+ label: hasInheritedRestriction ? t("Restricted by parent") : t("Open"),
+ description: hasInheritedRestriction
+ ? t("Use only inherited restrictions")
+ : t("Everyone in this space can access"),
+ icon: IconShieldLock,
},
{
value: "restricted" as const,
label: t("Restricted"),
- description: t("Only specific people can view or edit"),
+ description: hasInheritedRestriction
+ ? t("Add restrictions on top of inherited")
+ : t("Only specific people can access"),
icon: IconLock,
},
];
- const currentOption = accessOptions.find((opt) => opt.value === value);
- const Icon = currentOption?.icon || IconWorld;
-
- if (isInherited) {
- return (
-
-
-
-
-
-
- {currentOption?.label}
-
-
- {currentOption?.description}
-
-
-
- );
- }
-
return (