From d29a935f121ec167fc39de8852f7c9b3f206d971 Mon Sep 17 00:00:00 2001 From: Anusha Unnam Date: Mon, 20 Mar 2017 21:52:32 +0000 Subject: [PATCH] Add description to policies in used_limits The 'discoverable' policy is not documented as it will be removed in a future change. blueprint policy-docs Change-Id: I0ac7bc060d96d1f8a66044dc32e83ea747a4a4f6 --- nova/policies/used_limits.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/nova/policies/used_limits.py b/nova/policies/used_limits.py index e2e44216c7..af35fc12a3 100644 --- a/nova/policies/used_limits.py +++ b/nova/policies/used_limits.py @@ -26,9 +26,22 @@ used_limits_policies = [ policy.RuleDefault( name=POLICY_ROOT % 'discoverable', check_str=base.RULE_ANY), - policy.RuleDefault( - name=BASE_POLICY_NAME, - check_str=base.RULE_ADMIN_API), + # TODO(aunnam): Remove this rule after we seperate the scope check from + # policies, as this is only checking the scope. + base.create_rule_default( + BASE_POLICY_NAME, + base.RULE_ADMIN_API, + """Shows rate and absolute limits for the project. + +This policy only checks if the user has access to the requested +project limits. And this check is performed only after the check +os_compute_api:limits passes""", + [ + { + 'method': 'GET', + 'path': '/limits' + } + ]), ]