Remove permissionId when creating roles and ensure all roles inherit basic

This commit is contained in:
Andrew Kingston 2024-10-22 13:47:38 +01:00
parent 69969e8cc5
commit 86620b9a26
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View File

@ -95,7 +95,7 @@
color: "var(--spectrum-global-color-gray-700)",
description: "Custom role",
},
permissionId: "write",
inherits: [Roles.BASIC],
})
await tick()
layoutAndFit()

View File

@ -201,7 +201,10 @@ export const roleToNode = role => {
// Converts a node structure back into a role doc
export const nodeToRole = ({ node, edges }) => ({
...get(roles).find(role => role._id === node.id),
inherits: edges.filter(x => x.target === node.id).map(x => x.source),
inherits: edges
.filter(x => x.target === node.id)
.map(x => x.source)
.concat(Roles.BASIC),
uiMetadata: {
displayName: node.data.displayName,
color: node.data.color,