Skip to content

Commit

Permalink
Set policy allow to true by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis531 committed Aug 29, 2024
1 parent 42081eb commit f95a625
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/slices/eventDetailsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit f95a625

Please sign in to comment.