Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,20 @@
watch: {
'groups': function() {
if (this.groups.length > 0) {
// Remove global admin role if user is assigned to any group
this.$refs.userDrawer.editedObject.global_admin = false;
// Remove global admin role if the assigned groups does not have global admin access
var groupHasGlobalAdmin = false;

this.groups.forEach(function(grpId) {
var group = groupsModel.data().find(function(grp) {
return grpId === grp._id;
});

if (group && group.global_admin === true) {
groupHasGlobalAdmin = true;
}
});

this.$refs.userDrawer.editedObject.global_admin = groupHasGlobalAdmin;
}

if (this.groups.length === 0) {
Expand Down Expand Up @@ -1152,4 +1164,4 @@
countlyVue.container.registerData("user-management/edit-user-drawer", {
component: Drawer
});
})();
})();
Loading