Skip to content

Commit

Permalink
fix private rule bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sundersc committed Apr 2, 2024
1 parent c2e16de commit 7c2b1c4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ const getReadRolesForField = (acm: AccessControlMatrix, readRoles: Array<string>
let allowedRoles = [...readRoles];

if (hasCognitoPrivateRole) {
allowedRoles = allowedRoles.filter((r) => !(r.startsWith(`${acm.getName()}:userPools:`) && r !== 'userPools:private'));
allowedRoles = allowedRoles.filter((r) => !(r.startsWith(`${acm.getName()}:userPools:`) && r !== `${acm.getName()}:userPools:private`));
}
if (hasOIDCPrivateRole) {
allowedRoles = allowedRoles.filter((r) => !(r.startsWith(`${acm.getName()}:oidc:`) && r !== 'oidc:private'));
allowedRoles = allowedRoles.filter((r) => !(r.startsWith(`${acm.getName()}:oidc:`) && r !== `${acm.getName()}:oidc:private`));
}
return allowedRoles;
};
Expand Down

0 comments on commit 7c2b1c4

Please sign in to comment.