This commit is contained in:
Chirag Aggarwal
2025-10-31 11:07:13 +05:30
parent 3d7251f66e
commit e5b29d919c
+5 -4
View File
@@ -987,12 +987,13 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
$fileSecurity = $bucket->getAttribute('fileSecurity', false);
$validator = new Authorization(Database::PERMISSION_READ);
$valid = $validator->isValid($bucket->getRead());
Console::info("File security: " . ($fileSecurity ? "true" : "false"));
Console::info("File valid: " . ($valid ? "true" : "false"));
Console::info("File token: " . ($isToken ? "true" : "false"));
if (!$fileSecurity && !$valid && !$isToken) {
throw new Exception(Exception::USER_UNAUTHORIZED);
} else {
Console::info("File security: " . ($fileSecurity ? "true" : "false"));
Console::info("File valid: " . ($valid ? "true" : "false"));
Console::info("File token: " . ($isToken ? "true" : "false"));
}
if ($fileSecurity && !$valid && !$isToken) {