Skip to content

Commit 092b7a0

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Pass the actual target in tenant networks policy"
2 parents ff1b230 + 3423d44 commit 092b7a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nova/api/openstack/compute/tenant_networks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def _get_default_networks(self):
7171
@wsgi.expected_errors(())
7272
def index(self, req):
7373
context = req.environ['nova.context']
74-
context.can(tn_policies.POLICY_NAME % 'list')
74+
context.can(tn_policies.POLICY_NAME % 'list',
75+
target={'project_id': context.project_id})
7576
networks = list(self.network_api.get_all(context))
7677
if not self._default_networks:
7778
self._refresh_default_networks()
@@ -82,7 +83,8 @@ def index(self, req):
8283
@wsgi.expected_errors(404)
8384
def show(self, req, id):
8485
context = req.environ['nova.context']
85-
context.can(tn_policies.POLICY_NAME % 'show')
86+
context.can(tn_policies.POLICY_NAME % 'show',
87+
target={'project_id': context.project_id})
8688
try:
8789
network = self.network_api.get(context, id)
8890
except exception.NetworkNotFound:

0 commit comments

Comments
 (0)