♻️ create table for resource policies associations with users

This commit is contained in:
Fred KISSIE
2026-02-24 03:05:51 +01:00
parent 0e4abdf4b6
commit 335411de4c
8 changed files with 106 additions and 66 deletions

View File

@@ -7,6 +7,7 @@ import {
CreditCard,
Fingerprint,
Globe,
GlobeIcon,
GlobeLock,
KeyRound,
Laptop,
@@ -63,18 +64,7 @@ export const orgNavSections = (env?: Env): SidebarNavSection[] => [
title: "sidebarClientResources",
href: "/{orgId}/settings/resources/client",
icon: <GlobeLock className="size-4 flex-none" />
},
...(build !== "oss"
? [
{
title: "sidebarResourcePolicies",
href: "/{orgId}/settings/resources/policies",
icon: (
<ShieldIcon className="size-4 flex-none" />
)
}
]
: [])
}
]
},
{
@@ -133,6 +123,24 @@ export const orgNavSections = (env?: Env): SidebarNavSection[] => [
href: "/{orgId}/settings/access/roles",
icon: <Users className="size-4 flex-none" />
},
...(build !== "oss"
? [
{
title: "sidebarPolicies",
icon: <ShieldIcon className="size-4 flex-none" />,
items: [
{
title: "sidebarResourcePolicies",
href: "/{orgId}/settings/policies/resources",
icon: (
<GlobeIcon className="size-4 flex-none" />
)
}
]
}
]
: []),
// PaidFeaturesAlert
...((build === "oss" && !env?.flags.disableEnterpriseFeatures) ||
build === "saas" ||

View File

@@ -72,24 +72,7 @@ export function ResourcePoliciesTable({
enableHiding: false,
friendlyName: t("name"),
header: () => <span className="p-3">{t("name")}</span>,
cell({ row }) {
const r = row.original;
return (
<div className="flex items-center gap-2">
<span>{r.name}</span>
{r.isDefault && (
<>
<Badge
variant="outlinePrimary"
className="flex items-center gap-1"
>
{t("resourcePoliciesDefaultBadgeText")}
</Badge>
</>
)}
</div>
);
}
cell: ({ row }) => <span>{row.original.name}</span>
},
{
id: "niceId",
@@ -183,7 +166,7 @@ export function ResourcePoliciesTable({
onAdd={() =>
startNavigation(() =>
router.push(
`/${orgId}/settings/resources/policies/create`
`/${orgId}/settings/policies/resources/create`
)
)
}