diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkProjectServiceImpl.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkProjectServiceImpl.java index 4c8a3127e..0d03466fb 100644 --- a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkProjectServiceImpl.java +++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkProjectServiceImpl.java @@ -514,9 +514,10 @@ public void transferProject(ProjectTransferRequest projectTransferRequest, DSSPr initProjectModifyRequest(projectModifyRequest,projectTransferRequest, oldProjectOwner); String newProjectOwner = projectTransferRequest.getTransferUserName(); - if (!dssWorkspaceUserService.getUserRoleByUserName(newProjectOwner).isEmpty()) { + Long count = dssWorkspaceUserService.getCountByUsername(newProjectOwner, (int)workspace.getWorkspaceId()); + if (count == null || count == 0) { dssUserService.insertIfNotExist(newProjectOwner, workspace); - List roles = Collections.singletonList(3); + List roles = Collections.singletonList(4); dssWorkspaceUserService.addWorkspaceUser(roles, workspace.getWorkspaceId(), newProjectOwner, "system", null); }