diff --git a/nova/policies/instance_actions.py b/nova/policies/instance_actions.py index 1e9995a74d8..ba723899bd1 100644 --- a/nova/policies/instance_actions.py +++ b/nova/policies/instance_actions.py @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_policy import policy - from nova.policies import base @@ -23,12 +21,33 @@ instance_actions_policies = [ - policy.RuleDefault( - name=POLICY_ROOT % 'events', - check_str=base.RULE_ADMIN_API), - policy.RuleDefault( - name=BASE_POLICY_NAME, - check_str=base.RULE_ADMIN_OR_OWNER), + base.create_rule_default( + POLICY_ROOT % 'events', + base.RULE_ADMIN_API, + """Add events details in action details for a server. + +This check is performed only after the check +os_compute_api:os-instance-actions passes""", + [ + { + 'method': 'GET', + 'path': '/servers/{server_id}/os-instance-actions/{request_id}' + } + ]), + base.create_rule_default( + BASE_POLICY_NAME, + base.RULE_ADMIN_OR_OWNER, + """List actions and show action details for a server.""", + [ + { + 'method': 'GET', + 'path': '/servers/{server_id}/os-instance-actions' + }, + { + 'method': 'GET', + 'path': '/servers/{server_id}/os-instance-actions/{request_id}' + } + ]), ]