Skip to content

Commit

Permalink
Fix one missed case for 8b04bfe
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonF committed Jun 20, 2024
1 parent d33bad2 commit 27aa955
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
eqlDoesIntersect,
fqnRelativeTo,
IsAllowedParams,
MissingContextException,
} from '../../policy/conditions';

const CQL_VAR = 'membershipRoles';
Expand Down Expand Up @@ -159,7 +160,9 @@ export const withScope = <T extends object>(obj: T, roles: ScopedRole[]) =>

export const getScope = (object?: HasScope): ScopedRole[] => {
if (!object) {
throw new Error("Needed object's scoped roles but object wasn't given");
throw new MissingContextException(
"Needed object's scoped roles but object wasn't given",
);
}

return Reflect.get(object, ScopedRoles) ?? Reflect.get(object, 'scope') ?? [];
Expand Down

0 comments on commit 27aa955

Please sign in to comment.