bug fix
This commit is contained in:
parent
d38fe65d2b
commit
3ec68ed0c1
|
@ -9,6 +9,7 @@ import io.metersphere.commons.utils.Pager;
|
||||||
import io.metersphere.controller.request.WorkspaceRequest;
|
import io.metersphere.controller.request.WorkspaceRequest;
|
||||||
import io.metersphere.dto.WorkspaceDTO;
|
import io.metersphere.dto.WorkspaceDTO;
|
||||||
import io.metersphere.dto.WorkspaceMemberDTO;
|
import io.metersphere.dto.WorkspaceMemberDTO;
|
||||||
|
import io.metersphere.service.OrganizationService;
|
||||||
import io.metersphere.service.WorkspaceService;
|
import io.metersphere.service.WorkspaceService;
|
||||||
import io.metersphere.user.SessionUtils;
|
import io.metersphere.user.SessionUtils;
|
||||||
import org.apache.shiro.authz.annotation.Logical;
|
import org.apache.shiro.authz.annotation.Logical;
|
||||||
|
@ -23,11 +24,14 @@ import java.util.List;
|
||||||
public class WorkspaceController {
|
public class WorkspaceController {
|
||||||
@Resource
|
@Resource
|
||||||
private WorkspaceService workspaceService;
|
private WorkspaceService workspaceService;
|
||||||
|
@Resource
|
||||||
|
private OrganizationService organizationService;
|
||||||
|
|
||||||
@PostMapping("add")
|
@PostMapping("add")
|
||||||
@RequiresRoles(RoleConstants.ORG_ADMIN)
|
@RequiresRoles(RoleConstants.ORG_ADMIN)
|
||||||
public Workspace addWorkspace(@RequestBody Workspace workspace) {
|
public Workspace addWorkspace(@RequestBody Workspace workspace) {
|
||||||
workspaceService.checkWorkspaceOwnerByOrgAdmin(workspace.getId());
|
String currentOrganizationId = SessionUtils.getCurrentOrganizationId();
|
||||||
|
organizationService.checkOrgOwner(currentOrganizationId);
|
||||||
return workspaceService.saveWorkspace(workspace);
|
return workspaceService.saveWorkspace(workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue