Skip to content

Commit 8ca92e6

Browse files
vagrantwaipeng
authored andcommitted
Fix cluster template default policy
In Change I643d408cde0d6e30812cf6429fb7118184793400 a bunch of actions were changed from is_admin:True or project_id:%(project_id)s to rule:deny_cluster_user Which means that those actions are not verifying that the project ID of a token matches the project ID of the resource. This only seems to work for resources that a user can otherwise see. As public cluster templates can be seen by a user, a user is hence able to delete a CT. Fix it so that CT can only be modifiable or deletable by admin or owner. Story: 2008824 Task: 42289 Change-Id: I6dec817725338387a614f83e85a5f1f2814b020e
1 parent 6951ac4 commit 8ca92e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

magnum/common/policies/cluster_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
),
3232
policy.DocumentedRuleDefault(
3333
name=CLUSTER_TEMPLATE % 'delete',
34-
check_str=base.RULE_DENY_CLUSTER_USER,
34+
check_str=base.RULE_ADMIN_OR_OWNER,
3535
description='Delete a cluster template.',
3636
operations=[
3737
{
@@ -121,7 +121,7 @@
121121
),
122122
policy.DocumentedRuleDefault(
123123
name=CLUSTER_TEMPLATE % 'update',
124-
check_str=base.RULE_DENY_CLUSTER_USER,
124+
check_str=base.RULE_ADMIN_OR_OWNER,
125125
description='Update an existing cluster template.',
126126
operations=[
127127
{

0 commit comments

Comments
 (0)