feat: 기업 사용자가 지반자료 입력 결과 보고서 접근 시 본인 프로젝트만 접근하도록 수정

main
thkim 2026-02-10 14:51:26 +09:00
parent 09f09766a2
commit d9821ee7da
2 changed files with 39 additions and 4 deletions

View File

@ -115,7 +115,7 @@ public class ManageListController {
int nCls = -1; int nCls = -1;
if( request.getSession() != null && request.getSession().getAttribute("CLS") != null ) { if( request.getSession() != null && request.getSession().getAttribute("CLS") != null ) {
MyUtil.getIntegerFromObject(request.getSession().getAttribute("CLS")); nCls = MyUtil.getIntegerFromObject(request.getSession().getAttribute("CLS"));
System.out.println("getManageList.do CLS:" + String.valueOf(nCls)); System.out.println("getManageList.do CLS:" + String.valueOf(nCls));
} }
strUtil sUtil = new strUtil(); strUtil sUtil = new strUtil();
@ -201,6 +201,31 @@ public class ManageListController {
mapMetaInfo = (HashMap) arrayMetaInfo.get(0); mapMetaInfo = (HashMap) arrayMetaInfo.get(0);
// 입력날짜 // 입력날짜
inputdata = wUtil.isNullOb(mapMetaInfo.get("INPUTDATE"),wUtil.getToday()); inputdata = wUtil.isNullOb(mapMetaInfo.get("INPUTDATE"),wUtil.getToday());
int nCls = -1;
if( request.getSession() != null && request.getSession().getAttribute("CLS") != null ) {
nCls = MyUtil.getIntegerFromObject(request.getSession().getAttribute("CLS"));
System.out.println("getManageList.do CLS:" + String.valueOf(nCls));
}
String loginUserId = String.valueOf(request.getSession().getAttribute("USERID"));
String ownerUserId = MyUtil.getStringFromObject( mapMetaInfo.get("USERID") );
if( loginUserId == null || loginUserId.trim().equals("") ) {
// 로그인이 필요한 서비스 입니다. 401
model.put("errorMessage", "로그인이 필요한 서비스 입니다.");
model.put("errorCode", 401);
return "/error";
}
if( ownerUserId == null || ownerUserId.trim().equals("") ) {
// 프로젝트 소유자 기업 아이디가 지정되어 있지 않습니다. 400: "요청하신 데이터의 상태가 이상해서 처리를 못 하겠어요." (데이터 부재/형식 오류)
model.put("errorMessage", "프로젝트 소유자 기업 아이디가 지정되어 있지 않습니다.");
model.put("errorCode", 400);
return "/error";
}
if( nCls == 1 && !loginUserId.trim().equals(ownerUserId.trim()) ) {
// 권한이 없습니다. 403
model.put("errorMessage", "권한이 없습니다.");
model.put("errorCode", 403);
return "/error";
}
} }
//프로젝트 정보 //프로젝트 정보

View File

@ -3,6 +3,17 @@
<html> <html>
<head> <head>
<title>지반정보 포털시스템 - 오류</title> <title>지반정보 포털시스템 - 오류</title>
<style>
.error-message-title {
font-size: 18px;
font-weight: 900;
margin: 0px;
}
.error-message {
font-size: 18px;
margin: 0px;
}
</style>
</head> </head>
<body> <body>
<div style="text-align: center; width: 100%; padding-top: 20px;"> <div style="text-align: center; width: 100%; padding-top: 20px;">
@ -16,9 +27,8 @@
<%-- 3. 컨트롤러에서 전달받은 에러 메시지 표시 --%> <%-- 3. 컨트롤러에서 전달받은 에러 메시지 표시 --%>
<c:if test="${not empty errorMessage}"> <c:if test="${not empty errorMessage}">
<br/> <br/>
<strong>[오류 상세 내용]</strong> <p class="error-message-title">[오류 상세 내용]</p>
<br/> <p class="error-message"><c:out value="${errorMessage}" /></p>
<c:out value="${errorMessage}" />
</c:if> </c:if>
</pre> </pre>
<br/> <br/>