From c2e69ff9ec467d2c77966def35d7b4d11f7a142e Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 25 Apr 2024 18:04:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2=E8=B6=8A=E6=9D=83=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/service/BaseCheckPermissionService.java | 6 +++--- .../main/java/io/metersphere/controller/UserController.java | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/service/BaseCheckPermissionService.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/service/BaseCheckPermissionService.java index 864659f611..138f8db9ae 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/service/BaseCheckPermissionService.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/service/BaseCheckPermissionService.java @@ -102,10 +102,10 @@ public class BaseCheckPermissionService { return; } UserDTO userDTO = baseUserService.getUserDTO(SessionUtils.getUserId()); - List groupIds = userDTO.getGroups() + List groupIds = userDTO.getUserGroups() .stream() - .filter(g -> StringUtils.equals(g.getType(), UserGroupType.WORKSPACE) && StringUtils.equals(g.getScopeId(), workspaceId)) - .map(Group::getId) + .filter(g -> StringUtils.equals(g.getSourceId(), workspaceId)) + .map(UserGroup::getId) .toList(); if (CollectionUtils.isEmpty(groupIds)) { MSException.throwException(Translator.get("check_owner_workspace")); diff --git a/system-setting/backend/src/main/java/io/metersphere/controller/UserController.java b/system-setting/backend/src/main/java/io/metersphere/controller/UserController.java index a55b17abdb..e5f1dc5229 100644 --- a/system-setting/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/system-setting/backend/src/main/java/io/metersphere/controller/UserController.java @@ -91,7 +91,6 @@ public class UserController { @PostMapping("/special/ws/member/list/{goPage}/{pageSize}") @RequiresPermissions(PermissionConstants.SYSTEM_WORKSPACE_READ) public Pager> getMemberListByAdmin(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) { - baseCheckPermissionService.checkWorkspacePermission(request.getWorkspaceId()); Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, baseUserService.getMemberList(request)); } @@ -99,7 +98,6 @@ public class UserController { @PostMapping("/special/ws/member/list/all") @RequiresPermissions(value = {PermissionConstants.SYSTEM_WORKSPACE_READ, PermissionConstants.WORKSPACE_USER_READ}, logical = Logical.OR) public List getMemberListByAdmin(@RequestBody QueryMemberRequest request) { - baseCheckPermissionService.checkWorkspacePermission(request.getWorkspaceId()); return baseUserService.getMemberList(request); }