]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Pass object to policy when finding fields to strip
authorSalvatore Orlando <salv.orlando@gmail.com>
Mon, 2 Jun 2014 10:14:02 +0000 (03:14 -0700)
committerJakub Libosvar <libosvar@redhat.com>
Wed, 4 Jun 2014 08:46:59 +0000 (10:46 +0200)
During the evaluation of fields to strip in responses to list
operations, pass also the first object in the list to the
policy engine.
This will avoid errors in policy evaluation if during
an upgrade from icehouse policy.json was not updated to remove
attribute-level policies dependent on resource values.

Closes-Bug: #1323715

Change-Id: Iaa6ed3bbf4a07ce0b614a4197cabdfa1cb36d427

neutron/api/v2/base.py

index 5692df01b9cd2fc2102ff4ba50b8dd49bf3cdeb4..2ed735e277c4fe744857609545d126bc17c947d7 100644 (file)
@@ -141,7 +141,7 @@ class Controller(object):
                 if policy.check(
                     context,
                     '%s:%s' % (self._plugin_handlers[self.SHOW], attr_name),
-                    None,
+                    data,
                     might_not_exist=True):
                     # this attribute is visible, check next one
                     continue