Merge tag '2023.10.2' into merge-upstream

This commit is contained in:
riku6460 2023-10-21 18:25:55 +09:00
commit 78835eac52
No known key found for this signature in database
GPG key ID: 27414FA27DB94CF6
282 changed files with 4676 additions and 4314 deletions

View file

@ -319,8 +319,9 @@ export class ApiCallService implements OnApplicationShutdown {
}
if (ep.meta.requireRolePolicy != null && !user!.isRoot) {
const myRoles = await this.roleService.getUserRoles(user!.id);
const policies = await this.roleService.getUserPolicies(user!.id);
if (!policies[ep.meta.requireRolePolicy]) {
if (!policies[ep.meta.requireRolePolicy] && !myRoles.some(r => r.isAdministrator)) {
throw new ApiError({
message: 'You are not assigned to a required role.',
code: 'ROLE_PERMISSION_DENIED',