kjbank.com 도메인 처리
This commit is contained in:
@@ -0,0 +1,38 @@
|
|||||||
|
package com.eactive.apim.portal.common.util;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 사용자 유형 판별 유틸리티
|
||||||
|
* 내부 운영자와 외부 사용자를 구분하는 공통 로직 제공
|
||||||
|
*/
|
||||||
|
public final class UserTypeUtil {
|
||||||
|
|
||||||
|
private UserTypeUtil() {
|
||||||
|
throw new IllegalStateException("Utility class");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String INTERNAL_EMAIL_DOMAIN = "@kjbank.com";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 현재 사용자가 내부 운영자인지 확인
|
||||||
|
* @param user 인증된 사용자 정보
|
||||||
|
* @return 내부 운영자 여부
|
||||||
|
*/
|
||||||
|
public static boolean isInternalUser(PortalAuthenticatedUser user) {
|
||||||
|
if (user == null || StringUtils.isEmpty(user.getEmailAddr())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return user.getEmailAddr().toLowerCase().endsWith(INTERNAL_EMAIL_DOMAIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 현재 로그인한 사용자가 내부 운영자인지 확인
|
||||||
|
* @return 내부 운영자 여부
|
||||||
|
*/
|
||||||
|
public static boolean isCurrentUserInternal() {
|
||||||
|
PortalAuthenticatedUser user = SecurityUtil.getPortalAuthenticatedUser();
|
||||||
|
return isInternalUser(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user