mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +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: {
|
case Permission.LIBRARY_READ: {
|
||||||
|
if (auth.user.isAdmin) {
|
||||||
|
return new Set(ids);
|
||||||
|
}
|
||||||
const isOwner = await this.repository.library.checkOwnerAccess(auth.user.id, 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));
|
const isPartner = await this.repository.library.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner));
|
||||||
return setUnion(isOwner, isPartner);
|
return setUnion(isOwner, isPartner);
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.LIBRARY_UPDATE: {
|
case Permission.LIBRARY_UPDATE: {
|
||||||
|
if (auth.user.isAdmin) {
|
||||||
|
return new Set(ids);
|
||||||
|
}
|
||||||
return await this.repository.library.checkOwnerAccess(auth.user.id, ids);
|
return await this.repository.library.checkOwnerAccess(auth.user.id, ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.LIBRARY_DELETE: {
|
case Permission.LIBRARY_DELETE: {
|
||||||
|
if (auth.user.isAdmin) {
|
||||||
|
return new Set(ids);
|
||||||
|
}
|
||||||
return await this.repository.library.checkOwnerAccess(auth.user.id, ids);
|
return await this.repository.library.checkOwnerAccess(auth.user.id, ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue