Skip to content

Commit

Permalink
iwp
Browse files Browse the repository at this point in the history
  • Loading branch information
bosschaert committed Feb 19, 2025
1 parent c74a8cb commit 7520939
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkgs/spacecat-shared-http-utils/src/auth/rbac/acls.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,19 @@ export default async function getAcls({ userId, imsOrgs, apiKey }) {
const acls = [];
// Generally there is only 1 organization, but the API returns an array so
// we'll iterate over it and use all the ACLs we find.
await imsOrgs.forEach(async (orgid) => {
for (const orgid of imsOrgs) {
const imsOrgId = orgid.split('@')[0];
// eslint-disable-next-line no-await-in-loop
const roles = await getDBRoles(dbClient, { imsUserId: userId, imsOrgId, apiKey });
if (roles === undefined || roles.size === 0) {
return;
// eslint-disable-next-line no-continue
continue;
}

// eslint-disable-next-line no-await-in-loop
const aclList = await getDBAcls(dbClient, imsOrgId, roles);
acls.push(...aclList);
});
}

return {
acls,
Expand Down

0 comments on commit 7520939

Please sign in to comment.