Skip to content

Commit ca942e9

Browse files
committed
[S-RBAC] Get QoS rule types API available for READER role
API call "get_rule_types" should be available in new policies for all users with READER role as this is kind of the same what was in the old policies (ANY). Depends-On: https://review.opendev.org/c/openstack/neutron-tempest-plugin/+/882818 Closes-Bug: #2018585 Change-Id: I8281bd8a902bcaba1187565e9610d598e4ebc254 (cherry picked from commit 01de74d) (cherry picked from commit c82eee0)
1 parent 9177e90 commit ca942e9

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

neutron/conf/policies/qos.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@
103103

104104
policy.DocumentedRuleDefault(
105105
name='get_rule_type',
106-
check_str=base.ADMIN,
106+
# NOTE(ralonsoh): it can't be ADMIN_OR_PROJECT_READER constant from the
107+
# base module because that is using "project_id" in the check string
108+
# and the rule type resource don't belongs to any project thus such
109+
# check string would fail enforcement.
110+
check_str='role:reader',
107111
scope_types=['project'],
108112
description='Get available QoS rule types',
109113
operations=[

neutron/tests/unit/conf/policies/test_qos.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,6 @@ def setUp(self):
210210
super(ProjectMemberQosRuleTypeTests, self).setUp()
211211
self.context = self.project_member_ctx
212212

213-
def test_get_rule_type(self):
214-
self.assertRaises(
215-
base_policy.PolicyNotAuthorized,
216-
policy.enforce,
217-
self.context, 'get_rule_type', self.target)
218-
219213

220214
class ProjectReaderQosRuleTypeTests(ProjectMemberQosRuleTypeTests):
221215

0 commit comments

Comments
 (0)