From 2bf0529f851772ff09aac2d9fc167e9aa0eacc2a Mon Sep 17 00:00:00 2001 From: Mustaque Ahmed Date: Tue, 14 Oct 2025 15:48:02 +0530 Subject: [PATCH] fix: coderabbitai comments --- app/controllers/api/storage.php | 2 +- app/controllers/shared/api.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index e9acc27d53..17954b67c5 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1124,7 +1124,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') // Update transformedAt only when image transformations are allowed // Do not count Console/privileged requests — we only want to record // transformedAt for actual API uses. - $allowTransformations = $bucket->getAttribute('transformations', true); + $allowTransformations = $bucket->getAttribute('imageTransformations', true); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); if ($allowTransformations && !$isPrivilegedUser) { $transformedAt = $file->getAttribute('transformedAt', ''); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 349c315030..70294d8826 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -590,7 +590,7 @@ App::init() // Only proceed for preview when not disabled; other routes unaffected // Skip the block only when transformations remain enabled. - if ($isImageTransformation && $isTransformationsBlocked) { + if ($isImageTransformation && $isTransformationsBlocked && !$isPrivilegedUser) { throw new Exception(Exception::STORAGE_TRANSFORMATIONS_DISABLED); }