summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2010-12-01 16:44:44 -0500
committerAdam Young <ayoung@redhat.com>2010-12-01 20:22:30 -0500
commit85d5bfd1b19b0ed6282a8c6cc056e8e550dde79d (patch)
treeaf643478743ecf455425f792687fd3043d14b7c6 /install
parent47d61e6cabc7a9053a7878ea3b8676ad59415f39 (diff)
downloadfreeipa-85d5bfd1b19b0ed6282a8c6cc056e8e550dde79d.tar.gz
freeipa-85d5bfd1b19b0ed6282a8c6cc056e8e550dde79d.tar.xz
freeipa-85d5bfd1b19b0ed6282a8c6cc056e8e550dde79d.zip
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
Diffstat (limited to 'install')
-rw-r--r--install/static/webui.js15
1 files 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 {