From 307ffc990dd3e9f97636a4616bc8f8afb9d19592 Mon Sep 17 00:00:00 2001 From: Alex Tran Date: Thu, 7 Mar 2024 12:03:21 -0600 Subject: [PATCH] fix(server): admin access to edit library --- server/src/domain/access/access.core.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/src/domain/access/access.core.ts b/server/src/domain/access/access.core.ts index 8602701072..7063cb49a2 100644 --- a/server/src/domain/access/access.core.ts +++ b/server/src/domain/access/access.core.ts @@ -262,16 +262,25 @@ export class AccessCore { } case Permission.LIBRARY_READ: { + if (auth.user.isAdmin) { + return new Set(ids); + } const isOwner = await this.repository.library.checkOwnerAccess(auth.user.id, ids); const isPartner = await this.repository.library.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner)); return setUnion(isOwner, isPartner); } case Permission.LIBRARY_UPDATE: { + if (auth.user.isAdmin) { + return new Set(ids); + } return await this.repository.library.checkOwnerAccess(auth.user.id, ids); } case Permission.LIBRARY_DELETE: { + if (auth.user.isAdmin) { + return new Set(ids); + } return await this.repository.library.checkOwnerAccess(auth.user.id, ids); }