Merge pull request #6102 from appwrite/fix-file-security-check
Fix fileSecurity check
This commit is contained in:
commit
017cd75071
1 changed files with 2 additions and 2 deletions
|
@ -1316,7 +1316,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId')
|
||||||
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
|
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fileSecurity = $bucket->getAttributes('fileSecurity', false);
|
$fileSecurity = $bucket->getAttribute('fileSecurity', false);
|
||||||
$validator = new Authorization(Database::PERMISSION_UPDATE);
|
$validator = new Authorization(Database::PERMISSION_UPDATE);
|
||||||
$valid = $validator->isValid($bucket->getUpdate());
|
$valid = $validator->isValid($bucket->getUpdate());
|
||||||
if (!$fileSecurity && !$valid) {
|
if (!$fileSecurity && !$valid) {
|
||||||
|
@ -1423,7 +1423,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId')
|
||||||
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
|
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fileSecurity = $bucket->getAttributes('fileSecurity', false);
|
$fileSecurity = $bucket->getAttribute('fileSecurity', false);
|
||||||
$validator = new Authorization(Database::PERMISSION_DELETE);
|
$validator = new Authorization(Database::PERMISSION_DELETE);
|
||||||
$valid = $validator->isValid($bucket->getDelete());
|
$valid = $validator->isValid($bucket->getDelete());
|
||||||
if (!$fileSecurity && !$valid) {
|
if (!$fileSecurity && !$valid) {
|
||||||
|
|
Loading…
Reference in a new issue