
--- src/main/java/com/takensoft/cms/cntnStats/service/Impl/CntnStatsServiceImpl.java
+++ src/main/java/com/takensoft/cms/cntnStats/service/Impl/CntnStatsServiceImpl.java
... | ... | @@ -334,8 +334,6 @@ |
334 | 334 |
return result; |
335 | 335 |
} catch (DataAccessException dae){ |
336 | 336 |
throw dae; |
337 |
- } catch (RuntimeException re){ |
|
338 |
- throw re; |
|
339 | 337 |
} catch (Exception e) { |
340 | 338 |
throw e; |
341 | 339 |
} |
--- src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
+++ src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 |
} catch (NullPointerException ne) { |
102 | 102 |
throw ne; |
103 | 103 |
} catch (Exception e) { |
104 |
- throw new RuntimeException(e); |
|
104 |
+ throw e; |
|
105 | 105 |
} |
106 | 106 |
} |
107 | 107 |
|
... | ... | @@ -131,7 +131,7 @@ |
131 | 131 |
} catch (NullPointerException ne) { |
132 | 132 |
throw ne; |
133 | 133 |
} catch (Exception e) { |
134 |
- throw new RuntimeException(e); |
|
134 |
+ throw e; |
|
135 | 135 |
} |
136 | 136 |
} |
137 | 137 |
|
... | ... | @@ -157,7 +157,7 @@ |
157 | 157 |
} catch(DataAccessException dae) { |
158 | 158 |
throw dae; |
159 | 159 |
} catch (Exception e) { |
160 |
- throw new RuntimeException(e); |
|
160 |
+ throw e; |
|
161 | 161 |
} |
162 | 162 |
} |
163 | 163 |
|
... | ... | @@ -181,7 +181,7 @@ |
181 | 181 |
} catch(DataAccessException dae) { |
182 | 182 |
throw dae; |
183 | 183 |
} catch (Exception e) { |
184 |
- throw new RuntimeException(e); |
|
184 |
+ throw e; |
|
185 | 185 |
} |
186 | 186 |
} |
187 | 187 |
/************************************** Hierachy 전용 **************************************/ |
... | ... | @@ -217,7 +217,7 @@ |
217 | 217 |
} catch (NullPointerException ne) { |
218 | 218 |
throw ne; |
219 | 219 |
} catch (Exception e) { |
220 |
- throw new RuntimeException(e); |
|
220 |
+ throw e; |
|
221 | 221 |
} |
222 | 222 |
} |
223 | 223 |
|
... | ... | @@ -264,7 +264,7 @@ |
264 | 264 |
} catch (NullPointerException ne) { |
265 | 265 |
throw ne; |
266 | 266 |
} catch (Exception e) { |
267 |
- throw new RuntimeException(e); |
|
267 |
+ throw e; |
|
268 | 268 |
} |
269 | 269 |
} |
270 | 270 |
|
... | ... | @@ -273,7 +273,6 @@ |
273 | 273 |
* @return int - 부서 정보 삭제 결과 |
274 | 274 |
* @throws CustomDeleteFailException - 삭제 실패 예외 발생 시 |
275 | 275 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
276 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
277 | 276 |
* @throws Exception - 그 외 예외 발생 시 |
278 | 277 |
* |
279 | 278 |
* 부서 정보 삭제 |
... | ... | @@ -281,22 +280,28 @@ |
281 | 280 |
@Override |
282 | 281 |
@Transactional(rollbackFor = Exception.class) |
283 | 282 |
public int deptDelete(DeptVO deptVO) { |
284 |
- int delResult = 0; // 부서 삭제 결과 |
|
285 |
- delResult = deptDAO.deleteDept(deptVO.getDeptId()); |
|
286 |
- if (delResult == 0) { |
|
287 |
- throw new CustomDeleteFailException("부서 삭제 실패"); |
|
288 |
- } |
|
289 |
- |
|
290 |
- int deptMberCnt = deptDAO.countDeptInDeptMbr(deptVO.getDeptId()); // 부서에 등록된 사용자 수 조회 |
|
291 |
- // 사용자가 있다면 부서 사용자 삭제 진행 |
|
292 |
- if(deptMberCnt > 0) { |
|
293 |
- int deleteDeptAuth = 0; // 부서 사용자 삭제 결과 |
|
294 |
- deleteDeptAuth = deptDAO.deleteDeptInDeptMbr(deptVO.getDeptId()); |
|
295 |
- if (deleteDeptAuth == 0) { |
|
296 |
- throw new CustomDeleteFailException("부서 사용자 삭제 실패"); |
|
283 |
+ try { |
|
284 |
+ int delResult = 0; // 부서 삭제 결과 |
|
285 |
+ delResult = deptDAO.deleteDept(deptVO.getDeptId()); |
|
286 |
+ if (delResult == 0) { |
|
287 |
+ throw new CustomDeleteFailException("부서 삭제 실패"); |
|
297 | 288 |
} |
289 |
+ |
|
290 |
+ int deptMberCnt = deptDAO.countDeptInDeptMbr(deptVO.getDeptId()); // 부서에 등록된 사용자 수 조회 |
|
291 |
+ // 사용자가 있다면 부서 사용자 삭제 진행 |
|
292 |
+ if (deptMberCnt > 0) { |
|
293 |
+ int deleteDeptAuth = 0; // 부서 사용자 삭제 결과 |
|
294 |
+ deleteDeptAuth = deptDAO.deleteDeptInDeptMbr(deptVO.getDeptId()); |
|
295 |
+ if (deleteDeptAuth == 0) { |
|
296 |
+ throw new CustomDeleteFailException("부서 사용자 삭제 실패"); |
|
297 |
+ } |
|
298 |
+ } |
|
299 |
+ return delResult; |
|
300 |
+ } catch (DataAccessException dae) { |
|
301 |
+ throw dae; |
|
302 |
+ } catch (Exception e) { |
|
303 |
+ throw e; |
|
298 | 304 |
} |
299 |
- return delResult; |
|
300 | 305 |
} |
301 | 306 |
|
302 | 307 |
/** |
... | ... | @@ -304,7 +309,6 @@ |
304 | 309 |
* @return int - 부서 사용자 정보 삭제 결과 |
305 | 310 |
* @throws CustomDeleteFailException - 삭제 실패 예외 발생 시 |
306 | 311 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
307 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
308 | 312 |
* @throws Exception - 그 외 예외 발생 시 |
309 | 313 |
* |
310 | 314 |
* 부서 사용자 삭제 |
... | ... | @@ -312,21 +316,27 @@ |
312 | 316 |
@Override |
313 | 317 |
@Transactional(rollbackFor = Exception.class) |
314 | 318 |
public int deptMbrDelete(List<DeptMbrVO> deptMbrList) { |
315 |
- int result = 0; // 부서 사용자 삭제 결과 |
|
316 |
- if(deptMbrList.size() == 0) return 0; |
|
319 |
+ try { |
|
320 |
+ int result = 0; // 부서 사용자 삭제 결과 |
|
321 |
+ if (deptMbrList.size() == 0) return 0; |
|
317 | 322 |
|
318 |
- for(DeptMbrVO vo : deptMbrList) { |
|
319 |
- Map<String, String> param = new HashMap<String, String>(); |
|
320 |
- param.put("mbrId", vo.getMbrId()); |
|
321 |
- if(deptDAO.findByDeptMber(param).size() > 0) { |
|
322 |
- int delMbrResult = deptDAO.deleteDeptMbr(param); // 부서 사용자 삭제 |
|
323 |
- if (delMbrResult == 0) { |
|
324 |
- throw new CustomDeleteFailException("부서 사용자 삭제 실패"); |
|
323 |
+ for (DeptMbrVO vo : deptMbrList) { |
|
324 |
+ Map<String, String> param = new HashMap<String, String>(); |
|
325 |
+ param.put("mbrId", vo.getMbrId()); |
|
326 |
+ if (deptDAO.findByDeptMber(param).size() > 0) { |
|
327 |
+ int delMbrResult = deptDAO.deleteDeptMbr(param); // 부서 사용자 삭제 |
|
328 |
+ if (delMbrResult == 0) { |
|
329 |
+ throw new CustomDeleteFailException("부서 사용자 삭제 실패"); |
|
330 |
+ } |
|
331 |
+ result += delMbrResult; |
|
325 | 332 |
} |
326 |
- result += delMbrResult; |
|
327 | 333 |
} |
334 |
+ return result; |
|
335 |
+ } catch (DataAccessException dae) { |
|
336 |
+ throw dae; |
|
337 |
+ } catch (Exception e) { |
|
338 |
+ throw e; |
|
328 | 339 |
} |
329 |
- return result; |
|
330 | 340 |
} |
331 | 341 |
|
332 | 342 |
/** |
... | ... | @@ -368,7 +378,7 @@ |
368 | 378 |
} catch (NullPointerException ne) { |
369 | 379 |
throw ne; |
370 | 380 |
} catch (Exception e) { |
371 |
- throw new RuntimeException(e); |
|
381 |
+ throw e; |
|
372 | 382 |
} |
373 | 383 |
} |
374 | 384 |
|
... | ... | @@ -420,7 +430,7 @@ |
420 | 430 |
} catch (NullPointerException ne) { |
421 | 431 |
throw ne; |
422 | 432 |
} catch (Exception e) { |
423 |
- throw new RuntimeException(e); |
|
433 |
+ throw e; |
|
424 | 434 |
} |
425 | 435 |
} |
426 | 436 |
/** |
... | ... | @@ -471,7 +481,7 @@ |
471 | 481 |
} catch (NullPointerException ne) { |
472 | 482 |
throw ne; |
473 | 483 |
} catch (Exception e) { |
474 |
- throw new RuntimeException(e); |
|
484 |
+ throw e; |
|
475 | 485 |
} |
476 | 486 |
} |
477 | 487 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
+++ src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 |
} catch (NullPointerException ne) { |
98 | 98 |
throw ne; |
99 | 99 |
} catch (Exception e) { |
100 |
- throw new RuntimeException(e); |
|
100 |
+ throw e; |
|
101 | 101 |
} |
102 | 102 |
} |
103 | 103 |
|
... | ... | @@ -253,7 +253,7 @@ |
253 | 253 |
} catch (NullPointerException ne) { |
254 | 254 |
throw ne; |
255 | 255 |
} catch (Exception e) { |
256 |
- throw new RuntimeException(e); |
|
256 |
+ throw e; |
|
257 | 257 |
} |
258 | 258 |
} |
259 | 259 |
|
... | ... | @@ -294,7 +294,7 @@ |
294 | 294 |
} catch (DataAccessException dae) { |
295 | 295 |
throw dae; |
296 | 296 |
} catch (Exception e) { |
297 |
- throw new RuntimeException(e); |
|
297 |
+ throw e; |
|
298 | 298 |
} |
299 | 299 |
} |
300 | 300 |
|
--- src/main/java/com/takensoft/common/config/SecurityConfig.java
+++ src/main/java/com/takensoft/common/config/SecurityConfig.java
... | ... | @@ -166,9 +166,8 @@ |
166 | 166 |
); |
167 | 167 |
|
168 | 168 |
http.authorizeHttpRequests((auth) -> auth |
169 |
- .requestMatchers("/", "/mbr/**", "/company/**", "/refresh/**", "/sys/**").permitAll() // 회원관련, 시스템 제공 관련, 기업용페이지는 누구나 접근 가능 |
|
169 |
+ .requestMatchers("/", "/mbr/**", "/refresh/**", "/sys/**", "/editFileUpload/**", "/fileUpload/**").permitAll() // 회원, 토큰, 시스템 제공, 파일 접근 모두 허용 |
|
170 | 170 |
.requestMatchers("/admin/**").hasRole("ADMIN") // 관리자 페이지는 ADMIN 권한을 가진 사용자만 접근 가능 |
171 |
- .requestMatchers("/editFileUpload/**", "/fileUpload/**").permitAll() // 에디터 파일 업로드 |
|
172 | 171 |
.anyRequest().authenticated() // 그 외에는 로그인한 사용자만 접근 가능 |
173 | 172 |
// .anyRequest().permitAll() // 모든 사용자 접근 가능 |
174 | 173 |
); |
--- src/main/java/com/takensoft/common/filter/AccesFilter.java
+++ src/main/java/com/takensoft/common/filter/AccesFilter.java
... | ... | @@ -8,6 +8,7 @@ |
8 | 8 |
import org.springframework.http.HttpStatus; |
9 | 9 |
import org.springframework.http.MediaType; |
10 | 10 |
import org.springframework.security.web.util.matcher.AntPathRequestMatcher; |
11 |
+import org.springframework.util.AntPathMatcher; |
|
11 | 12 |
import org.springframework.web.filter.OncePerRequestFilter; |
12 | 13 |
|
13 | 14 |
import jakarta.servlet.FilterChain; |
... | ... | @@ -64,9 +65,15 @@ |
64 | 65 |
List<AccesCtrlVO> accesCtrlList = accesCtrlService.findAllAccesCtrlSecurity(ipAdrs); |
65 | 66 |
|
66 | 67 |
// 접근 제어 정보가 없거나 접근 제어가 허용된 경우 다음 필터로 이동 |
67 |
- if(accesCtrlList.isEmpty() || isAccesCntrl(accesCtrlList, request)) { |
|
68 |
- filterChain.doFilter(request, response); |
|
69 |
- return; |
|
68 |
+ if(accesCtrlList.isEmpty()) { |
|
69 |
+ // 대역대 확인 |
|
70 |
+ String bandIp = ipAdrs.replaceAll("\\.\\d+$", ".*"); |
|
71 |
+ accesCtrlList = accesCtrlService.findAllAccesCtrlSecurity(bandIp); |
|
72 |
+ if(accesCtrlList.isEmpty() || isAccesCntrl(accesCtrlList, request)) { |
|
73 |
+ |
|
74 |
+ filterChain.doFilter(request, response); |
|
75 |
+ return; |
|
76 |
+ } |
|
70 | 77 |
} |
71 | 78 |
// 접근 제어가 제한된 경우 에러 발생 |
72 | 79 |
ErrorResponse errorResponse = new ErrorResponse(); |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?