diff options
author | Lance Bragstad <lbragstad@gmail.com> | 2020-10-28 16:35:08 +0000 |
---|---|---|
committer | Brian Rosmaita <rosmaita.fossdev@gmail.com> | 2021-09-10 17:33:38 -0400 |
commit | 5fc7df24a549603652171edccd4422d84f9500c1 (patch) | |
tree | 679c8464346bc0e7ed5e495c4ca2787a643eb43b /cinder/api/contrib | |
parent | 7c556df2495a58798d7c08efcf1c1a43375171bb (diff) | |
download | cinder-5fc7df24a549603652171edccd4422d84f9500c1.tar.gz |
Xena project personas for volume type access API
Implements the 3 Xena personas (no system scope). Also introduces
a new policy 'volume_extension:volume_type_access:get_all_for_type'
that governs the GET /types/{type_id}/os-volume-type-access call.
Also removes an overriding policy definition from policy.yaml in
cinder/tests/unit/ that doesn't appear to be needed.
Co-authored-by: Lance Bragstad <lbragstad@gmail.com>
Co-authored-by: Brian Rosmaita <rosmaita.fossdev@gmail.com>
Change-Id: I6db266315efa02f08dfc0c069514f2ff9b8c551e
Diffstat (limited to 'cinder/api/contrib')
-rw-r--r-- | cinder/api/contrib/volume_type_access.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cinder/api/contrib/volume_type_access.py b/cinder/api/contrib/volume_type_access.py index 344f58b51..1ac10172a 100644 --- a/cinder/api/contrib/volume_type_access.py +++ b/cinder/api/contrib/volume_type_access.py @@ -40,7 +40,7 @@ class VolumeTypeAccessController(object): def index(self, req, type_id): context = req.environ['cinder.context'] - context.authorize(policy.TYPE_ACCESS_POLICY) + context.authorize(policy.TYPE_ACCESS_WHO_POLICY) # Not found exception will be handled at the wsgi level vol_type = volume_types.get_volume_type( @@ -77,6 +77,7 @@ class VolumeTypeActionController(wsgi.Controller): vol_type = req.cached_resource_by_id(type_id, name='types') self._extend_vol_type(vol_type_rval, vol_type) + # TODO: remove this, there is no /types/detail call for this to extend @wsgi.extends def detail(self, req, resp_obj): context = req.environ['cinder.context'] |