From a4d991f848348f9b3a3745761c772ba58a7ae572 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 9 Feb 2012 14:02:24 -0800 Subject: [PATCH] bug 13534: template page - remove "All" drop down choice from domain-admin user because API doesn't support it yet. (no templatefilter is for domain-admin to see all templates in his domain). --- ui/scripts/templates.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 6f76bb16b9a..69f48d4d8fe 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -16,7 +16,7 @@ filters: { all: { preFilter: function(args) { - if (isAdmin() || isDomainAdmin()) + if (isAdmin()) //"listTemplates&templatefilter=all" only works for root-admin, but no domain-admin. Domain-admin is unable to see all templates until listTemplates API supports a new type of templatefilter for domain-admin to see all templates in his domain. return true; else return false; @@ -684,7 +684,15 @@ listView: { label: 'ISOs', filters: { - all: { label: 'All' }, + all: { + preFilter: function(args) { + if (isAdmin()) //"listIsos&filter=all" only works for root-admin, but no domain-admin. Domain-admin is unable to see all Isos until listIsos API supports a new type of isofilter for domain-admin to see all Isos in his domain. + return true; + else + return false; + }, + label: 'All' + }, mine: { label: 'Mine' }, featured: { label: 'Featured' }, community: { label: 'Community' }