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 23
23
24
24
baremetal_nodes_policies = [
25
25
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.
29
29
30
30
These APIs are proxy calls to the Ironic service and are deprecated.
31
31
""" ,
32
- [
32
+ operations = [
33
33
{
34
34
'method' : 'GET' ,
35
35
'path' : '/os-baremetal-nodes'
38
38
'method' : 'GET' ,
39
39
'path' : '/os-baremetal-nodes/{node_id}'
40
40
}
41
- ]),
41
+ ],
42
+ scope_types = ['system' ]),
42
43
]
43
44
44
45
Original file line number Diff line number Diff line change @@ -88,3 +88,17 @@ class BaremetalNodesScopeTypePolicyTest(BaremetalNodesPolicyTest):
88
88
def setUp (self ):
89
89
super (BaremetalNodesScopeTypePolicyTest , self ).setUp ()
90
90
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