diff options
| author | Paul Voccio <paul@openstack.org> | 2012-07-13 14:21:22 -0700 |
|---|---|---|
| committer | Paul Voccio <paul@openstack.org> | 2012-07-16 09:10:58 -0700 |
| commit | 0766ec0da0d19be32c2ac07f480b3cb873d8037d (patch) | |
| tree | 533ae83b7af2554a5624e84cde8b796e7dec657d /nova/api | |
| parent | 57e4ee833d1897b5114be193be3b6f7fa38f49bf (diff) | |
Adding granularity for quotas to list and update
added quotas:show and quotas:update to policy.json
defaulting quotas:update to an admin-api default
Change-Id: Ib328912be859512b9c5391d9b7aa317ecf29aeab
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/quotas.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nova/api/openstack/compute/contrib/quotas.py b/nova/api/openstack/compute/contrib/quotas.py index 361335927..33584badc 100644 --- a/nova/api/openstack/compute/contrib/quotas.py +++ b/nova/api/openstack/compute/contrib/quotas.py @@ -29,7 +29,8 @@ from nova import quota QUOTAS = quota.QUOTAS -authorize = extensions.extension_authorizer('compute', 'quotas') +authorize_update = extensions.extension_authorizer('compute', 'quotas:update') +authorize_show = extensions.extension_authorizer('compute', 'quotas:show') class QuotaTemplate(xmlutil.TemplateBuilder): @@ -73,7 +74,7 @@ class QuotaSetsController(object): @wsgi.serializers(xml=QuotaTemplate) def show(self, req, id): context = req.environ['nova.context'] - authorize(context) + authorize_show(context) try: sqlalchemy_api.authorize_project_context(context, id) return self._format_quota_set(id, self._get_quotas(context, id)) @@ -83,7 +84,7 @@ class QuotaSetsController(object): @wsgi.serializers(xml=QuotaTemplate) def update(self, req, id, body): context = req.environ['nova.context'] - authorize(context) + authorize_update(context) project_id = id for key in body['quota_set'].keys(): if key in QUOTAS: @@ -100,7 +101,7 @@ class QuotaSetsController(object): @wsgi.serializers(xml=QuotaTemplate) def defaults(self, req, id): context = req.environ['nova.context'] - authorize(context) + authorize_show(context) return self._format_quota_set(id, QUOTAS.get_defaults(context)) |
