Merge "Introduce scope_types in os-services"

This commit is contained in:
Zuul
2019-11-29 18:50:11 +00:00
committed by Gerrit Code Review
2 changed files with 14 additions and 1 deletions

View File

@@ -59,7 +59,8 @@ services_policies = [
'method': 'DELETE',
'path': '/os-services/{service_id}'
}
]),
],
scope_types=['system']),
]

View File

@@ -97,3 +97,15 @@ class ServicesScopeTypePolicyTest(ServicesPolicyTest):
def setUp(self):
super(ServicesScopeTypePolicyTest, self).setUp()
self.flags(enforce_scope=True, group="oslo_policy")
# Check that system admin is able to change the service
self.admin_authorized_contexts = [
self.system_admin_context]
# Check that non-system or non-admin is not able to change the service
self.admin_unauthorized_contexts = [
self.legacy_admin_context, self.system_member_context,
self.system_reader_context, self.system_foo_context,
self.project_admin_context, self.project_member_context,
self.other_project_member_context,
self.project_foo_context, self.project_reader_context
]