Skip to content

Commit

Permalink
Fetch only routers in project of context['tenant_id'] when non-admin
Browse files Browse the repository at this point in the history
is requesting router-list without filters.

Change-Id: Ibb48aede78f336bf4301d08f126d28e2fab2d68a
Closes-Bug: 1596722
  • Loading branch information
Hampapur Ajay committed Jun 27, 2016
1 parent 3fd4544 commit 51c6303
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py
Expand Up @@ -3172,9 +3172,14 @@ def router_list(self, context=None, filters=None):
except NoIdError:
pass
else:
# read all routers in all projects
project_rtrs = self._router_list_project()
all_rtrs.append(project_rtrs)
if not context['is_admin']:
project_id = str(uuid.UUID(context['tenant']))
else:
project_id = None

# read all routers in specified projects
project_rtrs = self._router_list_project(project_id=project_id)
all_rtrs.append(project_rtrs)

# prune phase
for project_rtrs in all_rtrs:
Expand Down

0 comments on commit 51c6303

Please sign in to comment.