]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Filter out extra-specs from type get for non-admin
authorJohn Griffith <john.griffith8@gmail.com>
Wed, 19 Aug 2015 17:42:40 +0000 (17:42 +0000)
committerJohn Griffith <john.griffith8@gmail.com>
Tue, 25 Aug 2015 23:57:55 +0000 (17:57 -0600)
commit0cfa9b62410ab74ce840c3b580318eae6ddfc804
tree59ee5a1e5354a785134664a1cb3d13d82333ab05
parent25d90467b176463b609834ceb5851920896c6975
Filter out extra-specs from type get for non-admin

Currently when a get_volume type call is made to the
db api, we don't check context and auto-fill the
extra-specs info for that type.

Extra specs are intended to be admin only info, but anybody
that calls the API directly to list or get volume-types is
also given this info which is not intended.

This patch just adds a context check to the db api's
private extra-specs builder method.  In the case of
non-admin, we just skip adding the extra-specs.

Change-Id: Ia46695a6c890c06d94e6903ed9c54794107fa132
Closes-Bug: #1351971
Closes-Bug: #1475285
cinder/db/sqlalchemy/api.py
cinder/tests/unit/test_volume_types.py