From 85d5bfd1b19b0ed6282a8c6cc056e8e550dde79d Mon Sep 17 00:00:00 2001 From: Adam Young Date: Wed, 1 Dec 2010 16:44:44 -0500 Subject: [PATCH] admin determination extends the logic for showing the admin or self service ui to admins by checking for membership in the group admins added check for group admins --- install/static/webui.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/install/static/webui.js b/install/static/webui.js index 4b2156c01..dd90b0e20 100644 --- a/install/static/webui.js +++ b/install/static/webui.js @@ -93,9 +93,21 @@ IPA.tab_state = function(entity_name){ } } + + /* main (document onready event handler) */ $(function() { + function should_show_all_ui(){ + var whoami = IPA.whoami; + + if (whoami.hasOwnProperty('memberof_group') && + whoami.memberof_group.indexOf('admins') !== -1) return true; + + return whoami.hasOwnProperty('memberof_rolegroup') && + whoami.memberof_rolegroup.length > 0; + } + function init_on_win(data, text_status, xhr) { $(window).bind('hashchange', window_hashchange); @@ -113,8 +125,7 @@ $(function() { var navigation = $('#navigation'); - if (whoami.hasOwnProperty('memberof_rolegroup') && - whoami.memberof_rolegroup.length > 0){ + if (should_show_all_ui()){ IPA.tab_set = admin_tab_set; nav_create(admin_tab_set, navigation, 'tabs'); } else {