Skip to content

Commit 4ea6dbe

Browse files
committed
add blazar policy file
1 parent 36ff509 commit 4ea6dbe

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Default rule for most Admin APIs.
2+
#"admin": "is_admin:True or role:admin"
3+
4+
# Default rule for most non-Admin APIs.
5+
"admin_or_owner": "rule:admin or project_id:%(project_id)s"
6+
7+
# Policy rule for List/Show Lease(s) API.
8+
# GET /{api_version}/leases
9+
# GET /{api_version}/leases/{lease_id}
10+
#"blazar:leases:get": "rule:admin_or_owner"
11+
12+
# Policy rule for Delete Lease API.
13+
# DELETE /{api_version}/leases/{lease_id}
14+
#"blazar:leases:delete": "rule:admin_or_owner"
15+
16+
# Policy rule for List/Show Host(s) API.
17+
# GET /{api_version}/os-hosts
18+
# GET /{api_version}/os-hosts/{host_id}
19+
"blazar:oshosts:get": "rule:admin_or_owner"
20+
21+
# Policy rule for Delete Host API.
22+
# DELETE /{api_version}/os-hosts/{host_id}
23+
"blazar:oshosts:delete": "rule:admin_api"
24+
25+
# Policy rule for List/Get Host(s) Allocations API.
26+
# GET /{api_version}/os-hosts/allocations
27+
# GET /{api_version}/os-hosts/{host_id}/allocation
28+
"blazar:oshosts:get_allocations": "rule:admin_or_owner"
29+
30+
# Policy rule for Reallocate Host API.
31+
# PUT /{api_version}/os-hosts/{host_id}/allocation
32+
"blazar:oshosts:reallocate": "rule:admin_api"
33+
34+
# Policy rule for Resource Properties API.
35+
# GET /{api_version}/os-hosts/resource_properties
36+
"blazar:oshosts:get_resource_properties": "@"
37+
38+
# Policy rule for Resource Properties API.
39+
# PATCH /{api_version}/os-hosts/resource_properties/{property_name}
40+
"blazar:oshosts:patch_resource_properties": "rule:admin_api"
41+
42+
# Policy rule for List/Show Network(s) API.
43+
# GET /{api_version}/networks
44+
# GET /{api_version}/networks/{network_id}
45+
"blazar:networks:get": "rule:admin_or_owner"
46+
47+
# Policy rule for Delete Network API.
48+
# DELETE /{api_version}/networks/{network_id}
49+
"blazar:networks:delete": "rule:admin_api"
50+
51+
# Policy rule for List/Get Network(s) Allocations API.
52+
# GET /{api_version}/networks/allocations
53+
# GET /{api_version}/networks/{network_id}/allocation
54+
"blazar:networks:get_allocations": "rule:admin_or_owner"
55+
56+
# Policy rule for Resource Properties API.
57+
# GET /{api_version}/networks/resource_properties
58+
"blazar:networks:get_resource_properties": "@"
59+
60+
# Policy rule for Resource Properties API.
61+
# PATCH /{api_version}/networks/resource_properties/{property_name}
62+
"blazar:networks:patch_resource_properties": "rule:admin_api"
63+
64+
# Policy rule for List/Show Device(s) API.
65+
# GET /{api_version}/devices
66+
# GET /{api_version}/devices/{device_id}
67+
"blazar:devices:get": "rule:admin_or_owner"
68+
69+
# Policy rule for Update Host API.
70+
# PUT /{api_version}/devices/{device_id}
71+
"blazar:devices:put": "rule:admin_api"
72+
73+
# Policy rule for Delete Device API.
74+
# DELETE /{api_version}/devices/{device_id}
75+
"blazar:devices:delete": "rule:admin_api"
76+
77+
# Policy rule for List/Get Device(s) Allocations API.
78+
# GET /{api_version}/devices/allocations
79+
# GET /{api_version}/devices/{device_id}/allocation
80+
"blazar:devices:get_allocations": "rule:admin_or_owner"
81+
82+
# Policy rule for Resource Properties API.
83+
# GET /{api_version}/devices/resource_properties
84+
"blazar:devices:get_resource_properties": "@"
85+
86+
# Policy rule for Resource Properties API.
87+
# PATCH /{api_version}/devices/resource_properties/{property_name}
88+
"blazar:devices:patch_resource_properties": "rule:admin_api"
89+
90+
"default": "!"
91+
"admin_api": "role:admin"
92+
"blazar:leases:create": "rule:admin_or_owner"
93+
"blazar:leases:update": "rule:admin_or_owner"
94+
"blazar:plugins:get": "@"
95+
"blazar:oshosts:create": "rule:admin_api"
96+
"blazar:oshosts:update": "rule:admin_api"
97+
"blazar:oshosts:list_allocations": "rule:admin_or_owner"
98+
"blazar:networks:create": "rule:admin_api"
99+
"blazar:networks:update": "rule:admin_api"
100+
"blazar:networks:put": "rule:admin_or_owner"
101+
"blazar:networks:list_allocations": "rule:admin_or_owner"
102+
"blazar:devices:create": "rule:admin_api"
103+
"blazar:devices:update": "rule:admin_api"
104+
"blazar:devices:list_allocations": "rule:admin_or_owner"

0 commit comments

Comments
 (0)