提交 3ec68ed0 编写于 作者: S shiziyuan9527

bug fix

上级 d38fe65d
......@@ -9,6 +9,7 @@ import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.WorkspaceRequest;
import io.metersphere.dto.WorkspaceDTO;
import io.metersphere.dto.WorkspaceMemberDTO;
import io.metersphere.service.OrganizationService;
import io.metersphere.service.WorkspaceService;
import io.metersphere.user.SessionUtils;
import org.apache.shiro.authz.annotation.Logical;
......@@ -23,11 +24,14 @@ import java.util.List;
public class WorkspaceController {
@Resource
private WorkspaceService workspaceService;
@Resource
private OrganizationService organizationService;
@PostMapping("add")
@RequiresRoles(RoleConstants.ORG_ADMIN)
public Workspace addWorkspace(@RequestBody Workspace workspace) {
workspaceService.checkWorkspaceOwnerByOrgAdmin(workspace.getId());
String currentOrganizationId = SessionUtils.getCurrentOrganizationId();
organizationService.checkOrgOwner(currentOrganizationId);
return workspaceService.saveWorkspace(workspace);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册