|
24 | 24 | assisted_volume_snapshots_policies = [
|
25 | 25 | policy.DocumentedRuleDefault(
|
26 | 26 | name=POLICY_ROOT % 'create',
|
27 |
| - check_str=base.SYSTEM_ADMIN, |
| 27 | + # TODO(gmann): This is internal API policy and called by |
| 28 | + # cinder. Add 'service' role in this policy so that cinder |
| 29 | + # can call it with user having 'service' role (not having |
| 30 | + # correct project_id). That is for phase-2 of RBAC goal and until |
| 31 | + # then, we keep it open for all admin in any project. We cannot |
| 32 | + # default it to PROJECT_ADMIN which has the project_id in |
| 33 | + # check_str and will fail if cinder call it with other project_id. |
| 34 | + check_str=base.ADMIN, |
28 | 35 | description="Create an assisted volume snapshot",
|
29 | 36 | operations=[
|
30 | 37 | {
|
31 | 38 | 'path': '/os-assisted-volume-snapshots',
|
32 | 39 | 'method': 'POST'
|
33 | 40 | }
|
34 | 41 | ],
|
35 |
| - scope_types=['system']), |
| 42 | + scope_types=['project']), |
36 | 43 | policy.DocumentedRuleDefault(
|
37 | 44 | name=POLICY_ROOT % 'delete',
|
38 |
| - check_str=base.SYSTEM_ADMIN, |
| 45 | + # TODO(gmann): This is internal API policy and called by |
| 46 | + # cinder. Add 'service' role in this policy so that cinder |
| 47 | + # can call it with user having 'service' role (not having |
| 48 | + # correct project_id). That is for phase-2 of RBAC goal and until |
| 49 | + # then, we keep it open for all admin in any project. We cannot |
| 50 | + # default it to PROJECT_ADMIN which has the project_id in |
| 51 | + # check_str and will fail if cinder call it with other project_id. |
| 52 | + check_str=base.ADMIN, |
39 | 53 | description="Delete an assisted volume snapshot",
|
40 | 54 | operations=[
|
41 | 55 | {
|
42 | 56 | 'path': '/os-assisted-volume-snapshots/{snapshot_id}',
|
43 | 57 | 'method': 'DELETE'
|
44 | 58 | }
|
45 | 59 | ],
|
46 |
| - scope_types=['system']), |
| 60 | + scope_types=['project']), |
47 | 61 | ]
|
48 | 62 |
|
49 | 63 |
|
|
0 commit comments