mirror of
https://github.com/immich-app/immich.git
synced 2024-11-16 02:18:50 -07:00
fix(server): admin access to edit library
This commit is contained in:
parent
9b1a379fa6
commit
307ffc990d
@ -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 New Issue
Block a user