Skip to content

Commit

Permalink
fix typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
riku6460 committed Sep 29, 2023
1 parent e2c9ed3 commit 9a9692d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/backend/src/server/api/ApiCallService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ export class ApiCallService implements OnApplicationShutdown {
if (ep.meta.requireRolePolicy != null && !user!.isRoot) {
const policies = await this.roleService.getUserPolicies(user!.id);
let denied: boolean;
if (Array.isArray(ep.meta.requireRolePolicy)) {
denied = ep.meta.requireRolePolicy.some(policy => !policies[policy]);
} else {
if (typeof ep.meta.requireRolePolicy === 'string') {
denied = !policies[ep.meta.requireRolePolicy];
} else {
denied = ep.meta.requireRolePolicy.some(policy => !policies[policy]);
}
if (denied) {
throw new ApiError({
Expand Down

0 comments on commit 9a9692d

Please sign in to comment.