From 4c8a799dcd420f4c674cb99fb9ed948a508ec0e7 Mon Sep 17 00:00:00 2001 From: Ankur Rishi Date: Thu, 24 Apr 2014 11:21:38 -0700 Subject: [PATCH] Pkg definition page should show owned pkgs for non-admins Currently, the package definitions page shows all packages to all users. This needs to be changed so that only admins see all packages on the package definition page while non-admins see only their own packages on the package definition page. This is needed for the bugfix in that we want the api search function to be able to return only packages that are deployable by the current tenant* in some situations while, in other situations, to return a list of packages appropriate for package editing views. * 'deployable by the current' tenant means enabled packages that are (a) public or (b) owned by the current user. Change-Id: I3032ba7756c150eeb8942a5991dd69ea153dad28 Partial-Bug: #1307963 --- muranodashboard/packages/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/muranodashboard/packages/views.py b/muranodashboard/packages/views.py index 3996e0ba1..f44c3cecc 100644 --- a/muranodashboard/packages/views.py +++ b/muranodashboard/packages/views.py @@ -30,7 +30,10 @@ class PackageDefinitionsView(tables.DataTableView): def get_data(self): pkgs = [] with api.handled_exceptions(self.request): - pkgs = api.muranoclient(self.request).packages.list() + pkgs = api.muranoclient(self.request).packages.filter( + include_disabled=True, + owned=True + ) return pkgs