diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.java index 57dfd286bf..5bff8104b1 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.java @@ -9,4 +9,5 @@ import java.util.List; public interface ExtWorkspaceMapper { List getWorkspaceWithOrg(@Param("request") WorkspaceRequest request); + List getWorkspaceIdsByOrgId(@Param("orgId") String orgId); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.xml index f864aec32a..34013f1817 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtWorkspaceMapper.xml @@ -13,4 +13,9 @@ order by w.update_time desc + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index ebb1c99ead..a5f0f33543 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -435,8 +435,12 @@ public class UserService { } public void delOrganizationMember(String organizationId, String userId) { + + List resourceIds = workspaceService.getWorkspaceIdsOrgId(organizationId); + resourceIds.add(organizationId); + UserRoleExample userRoleExample = new UserRoleExample(); - userRoleExample.createCriteria().andRoleIdLike("%org%").andUserIdEqualTo(userId).andSourceIdEqualTo(organizationId); + userRoleExample.createCriteria().andUserIdEqualTo(userId).andSourceIdIn(resourceIds); User user = userMapper.selectByPrimaryKey(userId); if (StringUtils.equals(organizationId, user.getLastOrganizationId())) { diff --git a/backend/src/main/java/io/metersphere/service/WorkspaceService.java b/backend/src/main/java/io/metersphere/service/WorkspaceService.java index 20dd34c259..5868b270d2 100644 --- a/backend/src/main/java/io/metersphere/service/WorkspaceService.java +++ b/backend/src/main/java/io/metersphere/service/WorkspaceService.java @@ -202,6 +202,10 @@ public class WorkspaceService { return resultWorkspaceList; } + public List getWorkspaceIdsOrgId(String orgId) { + return extWorkspaceMapper.getWorkspaceIdsByOrgId(orgId); + } + public void updateWorkspaceMember(WorkspaceMemberDTO memberDTO) { String workspaceId = memberDTO.getWorkspaceId(); String userId = memberDTO.getId(); diff --git a/frontend/src/business/components/settings/organization/OrganizationMember.vue b/frontend/src/business/components/settings/organization/OrganizationMember.vue index f18031d60f..dea048bed0 100644 --- a/frontend/src/business/components/settings/organization/OrganizationMember.vue +++ b/frontend/src/business/components/settings/organization/OrganizationMember.vue @@ -217,7 +217,7 @@ }) }, del(row) { - this.$confirm(this.$t('member.remove_member'), '', { + this.$confirm(this.$t('member.org_remove_member'), '', { confirmButtonText: this.$t('commons.confirm'), cancelButtonText: this.$t('commons.cancel'), type: 'warning' diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 7d64c7b9f8..df5d4e7636 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -314,6 +314,7 @@ export default { repeat_password: 'Repeat', inconsistent_passwords: 'The two passwords entered are inconsistent', remove_member: 'Are you sure you want to remove this member', + org_remove_member: 'Removing the user from the organization will also remove permissions from all workspaces under the organization. Are you sure you want to remove the member ?', input_id_or_email: 'Please enter user ID, or user Email', no_such_user: 'Without this user information, please enter the correct user ID or user Email!', }, diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index d237a3a018..fe6852309f 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -313,6 +313,7 @@ export default { repeat_password: '确认密码', inconsistent_passwords: '两次输入的密码不一致', remove_member: '确定要移除该成员吗', + org_remove_member: '将该用户从组织中移除,将同时移除该组织下所有工作空间的权限,确定要移除该成员吗?', input_id_or_email: '请输入用户 ID, 或者 用户邮箱', no_such_user: '无此用户信息, 请输入正确的用户 ID 或者 用户邮箱!', }, diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 7b78e3a37b..8429bff9f6 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -315,6 +315,7 @@ export default { repeat_password: '確認密碼', inconsistent_passwords: '兩次輸入的密碼不壹致', remove_member: '確定要移除該成員嗎', + org_remove_member: '將該用戶從組織中移除,將同時移除該組織下所有工作空間的權限,確定要移除該成員嗎?', input_id_or_email: '請輸入用戶 ID, 或者 用戶郵箱', no_such_user: '無此用戶信息, 請輸入正確的用戶 ID 或者 用戶郵箱!', },