mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
debug
This commit is contained in:
1 parent
3d7251f66e
commit
e5b29d919c
1 file changed
+5
-4
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user