Rename policies to prevent double scope usease

This commit is contained in:
Matej Bačo
2026-05-05 12:58:06 +02:00
parent 67ab29ffeb
commit b0220292a7
6 changed files with 21 additions and 9 deletions
+2 -2
View File
@@ -59,8 +59,8 @@ $admins = [
'oauth2.write',
'mocks.read',
'mocks.write',
'policies.read',
'policies.write',
'project.policies.read',
'project.policies.write',
'templates.read',
'templates.write',
'projects.write',
+13 -1
View File
@@ -44,11 +44,23 @@ return [
"category" => "Project",
],
"policies.read" => [
"description" =>
"Access to read project\'s policies. Replaced by \'project.policies.read\' for more granular control.",
"category" => "Project",
'deprecated' => true,
],
"policies.write" => [
"description" =>
"Access to update project\'s policies. Replaces by \'project.policies.read\' for more granular control.",
"category" => "Project",
'deprecated' => true,
],
"project.policies.read" => [
"description" =>
"Access to read project\'s policies",
"category" => "Project",
],
"policies.write" => [
"project.policies.write" => [
"description" =>
"Access to update project\'s policies",
"category" => "Project",
@@ -27,7 +27,7 @@ class Get extends Action
->setHttpPath('/v1/project/policies/:policyId')
->desc('Get project policy')
->groups(['api', 'project'])
->label('scope', 'policies.read')
->label('scope', ['policies.read', 'project.policies.read'])
->label('sdk', new Method(
namespace: 'project',
group: 'policies',
@@ -33,7 +33,7 @@ class XList extends Action
->setHttpPath('/v1/project/policies')
->desc('List project policies')
->groups(['api', 'project'])
->label('scope', 'policies.read')
->label('scope', ['policies.read', 'project.policies.read'])
->label('sdk', new Method(
namespace: 'project',
group: 'policies',
+2 -2
View File
@@ -380,8 +380,8 @@ class Migrations extends Action
'oauth2.write',
'mocks.read',
'mocks.write',
'policies.read',
'policies.write',
'project.policies.read',
'project.policies.write',
'templates.read',
'templates.write',
];
+2 -2
View File
@@ -173,8 +173,8 @@ trait ProjectCustom
'oauth2.write',
'mocks.read',
'mocks.write',
'policies.read',
'policies.write',
'project.policies.read',
'project.policies.write',
'templates.read',
'templates.write',
],