Skip to content

Commit

Permalink
fix: attempt to debug 500s on READ SELF
Browse files Browse the repository at this point in the history
  • Loading branch information
Gobot1234 committed Apr 23, 2024
1 parent e53fa74 commit 9ad9ed5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class CaslAbilityGuard implements CanActivate {
}

const ability = await this.authorizationService.defineAbilitiesFor(user);

throw new Error(`${ability}, ${subject}, ${requiredActions}`);
return requiredActions.every((action) => ability.can(action, subject === "SELF" ? "USER" : subject));
}
}

0 comments on commit 9ad9ed5

Please sign in to comment.