1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-19 18:26:46 +01:00

feat(server): require ASSET_DOWNLOAD premission for fullsize previews

This commit is contained in:
Eli Gao 2024-12-18 01:52:45 +08:00
parent 97b1261095
commit 87ce9db8fa

View file

@ -213,6 +213,7 @@ export class AssetMediaService extends BaseService {
if (size === AssetMediaSize.THUMBNAIL && thumbnailFile) {
filepath = thumbnailFile.path;
} else if (size === AssetMediaSize.FULLSIZE) {
await this.requireAccess({ auth, permission: Permission.ASSET_DOWNLOAD, ids: [id] });
// eslint-disable-next-line unicorn/prefer-ternary
if (mimeTypes.isWebSupportedImage(asset.originalPath)) {
filepath = asset.originalPath;