Skip to content

Commit

Permalink
Merge pull request #5743 from Countly/group-edit
Browse files Browse the repository at this point in the history
[SER-1784] [core] Update global admin check when updating group
  • Loading branch information
ArtursKadikis authored Nov 20, 2024
2 parents ece5c47 + e1434a6 commit 7a63ebc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Version 24.05.XX
Fixes:
- [script] Fixing bug with "delete_old_members" script that led to malformed requests
- [core] Fixed bug where changing passwords results in the loss of the "Global Admin" role

## Version 24.05.17
Fixes:
Expand Down
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
});
})();
})();

0 comments on commit 7a63ebc

Please sign in to comment.