Skip to content

Commit

Permalink
Merge branch 'acl-allow' of lkiesow/opencast-admin-interface into main
Browse files Browse the repository at this point in the history
Pull request #585

  Admin interface creates invalid ACLs
  • Loading branch information
gregorydlogan committed Jun 4, 2024
2 parents d890746 + d72e2bf commit d011079
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/utils/resourceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,19 +400,22 @@ export const prepareAccessPolicyRulesForPost = (policies) => {

// iterate through all policies provided by user and transform them into form required for request
for (let i = 0; policies.length > i; i++) {
access.acl.ace = access.acl.ace.concat(
{
if (policies[i].read) {
access.acl.ace = access.acl.ace.concat({
// @ts-expect-error TS(2769): No overload matches this call.
action: "read",
allow: policies[i].read,
role: policies[i].role,
},
{
});
}
if (policies[i].write) {
access.acl.ace = access.acl.ace.concat({
// @ts-expect-error TS(2769): No overload matches this call.
action: "write",
allow: policies[i].write,
role: policies[i].role,
}
);
});
}
if (policies[i].actions.length > 0) {
for (let j = 0; policies[i].actions.length > j; j++) {
access.acl.ace = access.acl.ace.concat({
Expand Down

0 comments on commit d011079

Please sign in to comment.