Skip to content

Commit

Permalink
Merge pull request #178 from d-sonuga/fix/graphql-authorization
Browse files Browse the repository at this point in the history
fix(plugin): auth-core now allows authorized users to perform actions…
  • Loading branch information
overbit authored Oct 5, 2023
2 parents 9ca68b8 + e44535f commit 22084db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/auth-core/src/static/auth/abac.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export function getInvalidAttributes(
// eslint-disable-next-line @typescript-eslint/ban-types
data: Object
): string[] {
const filteredData = permission.filter(data);
// The structuredClone call is necessary because the
// `Permission.filter` function doesn't consider objects
// with null prototypes. And in graphql requests, the
// object passed here by the request interceptor is an object
// with a null prototype.
const filteredData = permission.filter(structuredClone(data));
return Object.keys(data).filter((key) => !(key in filteredData));
}

0 comments on commit 22084db

Please sign in to comment.