mirror of
https://github.com/immich-app/immich.git
synced 2024-12-29 15:11:58 +00:00
fix(server): admin access to edit library
This commit is contained in:
parent
9b1a379fa6
commit
307ffc990d
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue