1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Merge pull request #6102 from appwrite/fix-file-security-check

Fix fileSecurity check
This commit is contained in:
Jake Barnby 2023-09-01 15:11:03 -04:00 committed by GitHub
commit 017cd75071
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1316,7 +1316,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId')
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
}
$fileSecurity = $bucket->getAttributes('fileSecurity', false);
$fileSecurity = $bucket->getAttribute('fileSecurity', false);
$validator = new Authorization(Database::PERMISSION_UPDATE);
$valid = $validator->isValid($bucket->getUpdate());
if (!$fileSecurity && !$valid) {
@ -1423,7 +1423,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId')
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
}
$fileSecurity = $bucket->getAttributes('fileSecurity', false);
$fileSecurity = $bucket->getAttribute('fileSecurity', false);
$validator = new Authorization(Database::PERMISSION_DELETE);
$valid = $validator->isValid($bucket->getDelete());
if (!$fileSecurity && !$valid) {