From f95a625d0d17e1dadc0b801e1ee97dd79d20be95 Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Thu, 29 Aug 2024 13:02:33 +0200 Subject: [PATCH] Set policy allow to true by default --- src/slices/eventDetailsSlice.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/slices/eventDetailsSlice.ts b/src/slices/eventDetailsSlice.ts index e8dfb3af44..e0a1423d61 100644 --- a/src/slices/eventDetailsSlice.ts +++ b/src/slices/eventDetailsSlice.ts @@ -870,13 +870,15 @@ export const fetchAccessPolicies = createAppAsyncThunk('eventDetails/fetchAccess for (let i = 0; i < json.length; i++) { const policy: Ace = json[i]; + // By default, allow is true + policy.allow ??= true; if (!newPolicies[policy.role]) { newPolicies[policy.role] = createPolicy(policy.role); policyRoles.push(policy.role); } if (policy.action === "read" || policy.action === "write") { newPolicies[policy.role][policy.action] = policy.allow; - } else if (policy.allow === true) { //|| policy.allow === "true") { + } else if (policy.allow) { newPolicies[policy.role].actions.push(policy.action); } }