mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
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
This commit is contained in:
parent
47d61e6cab
commit
85d5bfd1b1
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user