diff --git a/app/config/roles.php b/app/config/roles.php index 62efb4d809..33c7ffc9de 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -57,6 +57,7 @@ $admins = [ 'platforms.write', 'mocks.read', 'mocks.write', + 'policies.read', 'policies.write', 'templates.read', 'templates.write', diff --git a/app/config/scopes/project.php b/app/config/scopes/project.php index 2c78cb921c..592e032ba1 100644 --- a/app/config/scopes/project.php +++ b/app/config/scopes/project.php @@ -212,6 +212,10 @@ return [ // List of publicly visible scopes "description" => "Access to create, update, and delete project\'s mocks", ], + "policies.read" => [ + "description" => + "Access to read project\'s policies", + ], "policies.write" => [ "description" => "Access to update project\'s policies", diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index fa6e5c28ab..7c2f527ccf 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -977,12 +977,12 @@ Http::shutdown() if (! empty($data['payload']) && $statusCode >= 200 && $statusCode < 300) { $pattern = $route->getLabel('cache.resource', null); if (! empty($pattern)) { - $resource = $parseLabel($pattern, $responsePayload, $requestParams, $user); + $resource = $parseLabel($pattern, $responsePayload, $requestParams, $user, $project); } $pattern = $route->getLabel('cache.resourceType', null); if (! empty($pattern)) { - $resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user); + $resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user, $project); } $cache = new Cache( diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 0225983d2f..cfe8d2d567 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -393,6 +393,7 @@ class Migrations extends Action 'platforms.write', 'mocks.read', 'mocks.write', + 'policies.read', 'policies.write', 'templates.read', 'templates.write', diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index e5a86c07fd..f531ed774d 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -171,6 +171,7 @@ trait ProjectCustom 'platforms.write', 'mocks.read', 'mocks.write', + 'policies.read', 'policies.write', 'templates.read', 'templates.write',