fix(ApiCallService): logical OR

This commit is contained in:
オスカー、 2024-08-13 16:18:16 +09:00
parent a8d51ffe4c
commit ab68d1f75e
Signed by: SWREI
GPG Key ID: 139D6573F92DA9F7

View File

@ -310,7 +310,7 @@ export class ApiCallService implements OnApplicationShutdown {
} }
} }
if ((ep.meta.requireModerator ?? ep.meta.requireAdmin)) { if (ep.meta.requireModerator || ep.meta.requireAdmin) {
const myRoles = await this.roleService.getUserRoles(user!.id); const myRoles = await this.roleService.getUserRoles(user!.id);
const isModerator = myRoles.some(r => r.isModerator || r.isAdministrator); const isModerator = myRoles.some(r => r.isModerator || r.isAdministrator);
const isAdmin = myRoles.some(r => r.isAdministrator); const isAdmin = myRoles.some(r => r.isAdministrator);