File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed
frontend/express/public/core/user-management/javascripts Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 1- ## Version 24.05.xx
1+ ## Version 24.05.X
22Enterprise Fixes:
3+ - [ groups] Fix user permission update after updating user group permission
34- [ revenue] Card in revenue page are now correctly indentified
45
6+
57## Version 24.05.43
68Features:
79- [ core] Implement go to link in notification
Original file line number Diff line number Diff line change 847847 }
848848 } ,
849849 onOpen : function ( ) {
850+ this . patchUserPermission ( ) ;
850851 this . changePasswordFlag = false ;
851852 // types
852853 var types = [ 'c' , 'r' , 'u' , 'd' ] ;
860861 // if it's in edit mode
861862 if ( this . settings . editMode ) {
862863 // is user member of a group?
863- if ( this . user . group_id && countlyGlobal . plugins . indexOf ( 'groups' ) > - 1 ) {
864+ if ( this . user . group_id && this . user . group_id . length && countlyGlobal . plugins . indexOf ( 'groups' ) > - 1 ) {
864865 // set groups state
865866 if ( Array . isArray ( this . user . group_id ) ) {
866867 this . groups = this . user . group_id ;
963964 } ,
964965 onRoleChange : function ( role ) {
965966 this . roles [ role . name ] = role ;
966- }
967+ } ,
968+ patchUserPermission : function ( ) {
969+ if ( this . user && this . user . permission && this . user . permission . _ && this . user . permission . _ . u ) {
970+ var appIdReducer = function ( acc , curr ) {
971+ if ( curr . length > 0 ) {
972+ acc . push ( curr ) ;
973+ }
974+ return acc ;
975+ } ;
976+
977+ var _u = this . user . permission . _ . u . reduce ( function ( acc , curr ) {
978+ if ( curr . length > 0 ) {
979+ var appIds = curr . reduce ( appIdReducer , [ ] ) ;
980+
981+ if ( appIds . length > 0 ) {
982+ acc . push ( appIds ) ;
983+ }
984+ }
985+ return acc ;
986+ } , [ ] ) ;
987+
988+ this . user . permission . _ . u = _u ;
989+ this . $refs . userDrawer . editedObject . permission . _ . u = _u ;
990+ }
991+ } ,
967992 } ,
968993 watch : {
969994 'groups' : function ( ) {
You can’t perform that action at this time.
0 commit comments