File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 2323
2424baremetal_nodes_policies = [
2525 policy .DocumentedRuleDefault (
26- BASE_POLICY_NAME ,
27- base .RULE_ADMIN_API ,
28- """List and show details of bare metal nodes.
26+ name = BASE_POLICY_NAME ,
27+ check_str = base .RULE_ADMIN_API ,
28+ description = """List and show details of bare metal nodes.
2929
3030These APIs are proxy calls to the Ironic service and are deprecated.
3131""" ,
32- [
32+ operations = [
3333 {
3434 'method' : 'GET' ,
3535 'path' : '/os-baremetal-nodes'
3838 'method' : 'GET' ,
3939 'path' : '/os-baremetal-nodes/{node_id}'
4040 }
41- ]),
41+ ],
42+ scope_types = ['system' ]),
4243]
4344
4445
Original file line number Diff line number Diff line change @@ -88,3 +88,17 @@ class BaremetalNodesScopeTypePolicyTest(BaremetalNodesPolicyTest):
8888 def setUp (self ):
8989 super (BaremetalNodesScopeTypePolicyTest , self ).setUp ()
9090 self .flags (enforce_scope = True , group = "oslo_policy" )
91+
92+ # Check that system admin is able to get baremetal nodes.
93+ self .admin_authorized_contexts = [
94+ self .system_admin_context ]
95+ # Check that non-system or non-admin is not able to get
96+ # baremetal nodes.
97+ self .admin_unauthorized_contexts = [
98+ self .legacy_admin_context , self .system_member_context ,
99+ self .system_reader_context , self .system_foo_context ,
100+ self .project_admin_context , self .project_member_context ,
101+ self .other_project_member_context ,
102+ self .project_foo_context , self .project_reader_context ,
103+ self .other_project_reader_context
104+ ]
You can’t perform that action at this time.
0 commit comments