This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris-manager.git


The following commit(s) were added to refs/heads/master by this push:
     new 694d805  remove user from cluster space when removing it from admin 
role (#21)
694d805 is described below

commit 694d80568efeb6d1065ae0d0799aa343479b4288
Author: LiRui <[email protected]>
AuthorDate: Fri Mar 25 15:21:06 2022 +0800

    remove user from cluster space when removing it from admin role (#21)
    
    remove user from cluster space when removing it from admin role
---
 .../doris/stack/component/DorisManagerUserSpaceComponent.java       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/manager/dm-server/src/main/java/org/apache/doris/stack/component/DorisManagerUserSpaceComponent.java
 
b/manager/dm-server/src/main/java/org/apache/doris/stack/component/DorisManagerUserSpaceComponent.java
index c35f351..5a84325 100644
--- 
a/manager/dm-server/src/main/java/org/apache/doris/stack/component/DorisManagerUserSpaceComponent.java
+++ 
b/manager/dm-server/src/main/java/org/apache/doris/stack/component/DorisManagerUserSpaceComponent.java
@@ -304,8 +304,12 @@ public class DorisManagerUserSpaceComponent extends 
BaseService {
                 if (adminUserId < 0) {
                     continue;
                 }
-                // Delete the user from the space administrator role, but will 
not delete the user from the space?
+                // Delete the user from the space administrator role
                 
membershipRepository.deleteByUserIdAndGroupId(clusterInfo.getAdminGroupId(), 
adminUserId);
+
+                // also delete the user form all user role and cluster space
+                
membershipRepository.deleteByUserIdAndGroupId(clusterInfo.getAllUserGroupId(), 
adminUserId);
+                
clusterUserMembershipRepository.deleteByUserIdAndClusterId(adminUserId, 
clusterInfo.getId());
             }
 
         }

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to