diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index edaec56018..a7ec2b1a84 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1056,9 +1056,9 @@ App::post('/v1/projects/:projectId/platforms') $platform = new Document([ '$id' => ID::unique(), '$permissions' => [ - 'read(any)', - 'update(any)', - 'delete(any)', + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), ], 'projectInternalId' => $project->getInternalId(), 'projectId' => $project->getId(), @@ -1272,9 +1272,9 @@ App::post('/v1/projects/:projectId/domains') $domain = new Document([ '$id' => ID::unique(), '$permissions' => [ - 'read(any)', - 'update(any)', - 'delete(any)', + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), ], 'projectInternalId' => $project->getInternalId(), 'projectId' => $project->getId(), diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 3177f0c7f7..3698b479cb 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -469,9 +469,7 @@ App::post('/v1/storage/buckets/:bucketId/files') $path = $deviceFiles->getPath($fileId . '.' . \pathinfo($fileName, PATHINFO_EXTENSION)); $path = str_ireplace($deviceFiles->getRoot(), $deviceFiles->getRoot() . DIRECTORY_SEPARATOR . $bucket->getId(), $path); // Add bucket id to path after root - $file = Authorization::skip(function () use ($dbForProject, $bucket, $fileId) { - return $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); - }); + $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); $metadata = ['content_type' => $deviceLocal->getFileMimeType($fileTmpName)]; if (!$file->isEmpty()) { diff --git a/phpunit.xml b/phpunit.xml index e955ab7cee..58fc319ed8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -13,7 +13,7 @@ - ./tests/unit + ./tests/unit/ ./tests/e2e/Client.php