fix: 修复权限相关问题

This commit is contained in:
CaptainB 2022-06-09 19:08:48 +08:00 committed by 刘瑞斌
parent 3f9874cc81
commit 6c610b3b1b
2 changed files with 6 additions and 1 deletions

View File

@ -39,7 +39,6 @@ public class ProjectController {
private ApiTestEnvironmentService apiTestEnvironmentService;
@GetMapping("/listAll")
@RequiresPermissions(PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ)
public List<ProjectDTO> listAll() {
String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId();
ProjectRequest request = new ProjectRequest();

View File

@ -668,6 +668,12 @@ public class UserService {
if (workspaces.size() > 0) {
String wsId = workspaces.get(0).getSourceId();
switchUserResource("workspace", wsId);
} else {
// 用户登录之后没有项目和工作空间的权限就把值清空
user.setLastWorkspaceId("");
user.setLastProjectId("");
updateUser(user);
SessionUtils.putUser(SessionUser.fromUser(user));
}
} else {
UserGroup userGroup = project.stream().filter(p -> StringUtils.isNotBlank(p.getSourceId()))