File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed
frontend/express/public/core/user-management/javascripts Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 11## Version 25.03.X
2- Fixes:
2+ Enterprise Fixes:
33- [ ab-testing] Add script for fixing variant cohort
4+ - [ groups] Fix user permission update after updating user group permission
45
56
67## Version 25.03.24
Original file line number Diff line number Diff line change 866866 }
867867 } ,
868868 onOpen : function ( ) {
869+ this . patchUserPermission ( ) ;
869870 this . changePasswordFlag = false ;
870871 // types
871872 var types = [ 'c' , 'r' , 'u' , 'd' ] ;
879880 // if it's in edit mode
880881 if ( this . settings . editMode ) {
881882 // is user member of a group?
882- if ( this . user . group_id && countlyGlobal . plugins . indexOf ( 'groups' ) > - 1 ) {
883+ if ( this . user . group_id && this . user . group_id . length && countlyGlobal . plugins . indexOf ( 'groups' ) > - 1 ) {
883884 // set groups state
884885 if ( Array . isArray ( this . user . group_id ) ) {
885886 this . groups = this . user . group_id ;
982983 } ,
983984 onRoleChange : function ( role ) {
984985 this . roles [ role . name ] = role ;
985- }
986+ } ,
987+ patchUserPermission : function ( ) {
988+ if ( this . user && this . user . permission && this . user . permission . _ && this . user . permission . _ . u ) {
989+ var appIdReducer = function ( acc , curr ) {
990+ if ( curr . length > 0 ) {
991+ acc . push ( curr ) ;
992+ }
993+ return acc ;
994+ } ;
995+
996+ var _u = this . user . permission . _ . u . reduce ( function ( acc , curr ) {
997+ if ( curr . length > 0 ) {
998+ var appIds = curr . reduce ( appIdReducer , [ ] ) ;
999+
1000+ if ( appIds . length > 0 ) {
1001+ acc . push ( appIds ) ;
1002+ }
1003+ }
1004+ return acc ;
1005+ } , [ ] ) ;
1006+
1007+ this . user . permission . _ . u = _u ;
1008+ this . $refs . userDrawer . editedObject . permission . _ . u = _u ;
1009+ }
1010+ } ,
9861011 } ,
9871012 watch : {
9881013 'groups' : function ( ) {
You can’t perform that action at this time.
0 commit comments