Skip to content

Commit 09e6a0f

Browse files
committed
fix a permissions UI bug
1 parent 00224a4 commit 09e6a0f

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

packages/admin-vanilla/src/definition/renders.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,9 @@ function getLookupOptions(fieldKey: string, itemsByTab: AdminRecordStore): strin
6767
if (fieldKey === "plugins") {
6868
return Array.from(new Set(itemsByTab.plugins.map((item) => item.name).filter(Boolean)));
6969
}
70-
if (fieldKey === "userRoles") {
70+
if (fieldKey === "userRoles" || fieldKey === "bagPermissions" || fieldKey === "templatePermissions" || fieldKey === "recipePermissions") {
7171
return Array.from(new Set(itemsByTab.roles.map((item) => item.name).filter(Boolean)));
7272
}
73-
if (fieldKey === "permissions" || fieldKey === "recipePermissions") {
74-
return Array.from(new Set([
75-
...itemsByTab.bags.flatMap((item) => item.bagPermissions.map((row) => row.role)),
76-
...itemsByTab.wikis.flatMap((item) => item.recipePermissions.map((row) => row.role)),
77-
].filter(Boolean)));
78-
}
7973
return [];
8074
}
8175

packages/admin-vanilla/src/definition/tabs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ const tabs = {
382382
{ title: "Writable routing", description: writableRoutingDescription, keys: ["writablePrefixBags"], width: fullWidth },
383383
{ title: "Bags", keys: ["readonlyBags"], width: halfWidth },
384384
{ title: "Plugins", keys: ["plugins", "requiredPluginsEnabled"], width: halfWidth, layout: stackLayout },
385-
{ title: "Permissions", keys: ["templatePermissions"], width: fullWidth, layout: stackLayout },
385+
{ title: "Permissions", description: "Permissions for who can edit or use this template. Access to the template is required to apply it to a recipe, but not required to use that recipe.", keys: ["templatePermissions"], width: fullWidth, layout: stackLayout },
386386
{ title: "Custom HTML shell", keys: ["htmlContent", "injectionArray", "injectionLocation"], headerFieldKey: "customHtmlEnabled", disabledWhenHeaderOff: true, width: fullWidth, layout: stackLayout },
387387
],
388388
runtime: [

0 commit comments

Comments
 (0)