mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: coderabbitai comments
This commit is contained in:
@@ -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', '');
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user