Class UserMatchingFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- org.springframework.web.filter.OncePerRequestFilter
-
- de.hybris.platform.ycommercewebservices.v2.filter.AbstractUrlMatchingFilter
-
- de.hybris.platform.ycommercewebservices.v2.filter.UserMatchingFilter
-
- All Implemented Interfaces:
javax.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
public class UserMatchingFilter extends AbstractUrlMatchingFilter
Filter that puts user from the requested url into the session.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringROLE_ANONYMOUSstatic java.lang.StringROLE_CUSTOMERGROUPstatic java.lang.StringROLE_CUSTOMERMANAGERGROUPstatic java.lang.StringROLE_TRUSTED_CLIENT-
Fields inherited from class de.hybris.platform.ycommercewebservices.v2.filter.AbstractUrlMatchingFilter
BASE_SITES_ENDPOINT_PATH
-
-
Constructor Summary
Constructors Constructor Description UserMatchingFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)protected org.springframework.security.core.AuthenticationgetAuth()protected java.lang.StringgetRegexp()protected SessionServicegetSessionService()protected java.util.Optional<UserModel>getUserForValidProperty(java.lang.String principal, java.lang.String propertyValue)protected UserMatchingServicegetUserMatchingService()protected UserServicegetUserService()protected booleanhasRole(java.lang.String role, org.springframework.security.core.Authentication auth)protected voidsetCurrentUser(UserModel user)protected voidsetCurrentUser(java.lang.String id)protected voidsetCurrentUserForCustomerGroupRole(java.lang.String principal, java.lang.String userID)voidsetRegexp(java.lang.String regexp)voidsetSessionService(SessionService sessionService)voidsetUserMatchingService(UserMatchingService userMatchingService)voidsetUserService(UserService userService)-
Methods inherited from class de.hybris.platform.ycommercewebservices.v2.filter.AbstractUrlMatchingFilter
getBaseSiteValue, getMatcher, getPath, getValue, getValue, matchesUrl
-
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
-
-
-
-
Field Detail
-
ROLE_ANONYMOUS
public static final java.lang.String ROLE_ANONYMOUS
- See Also:
- Constant Field Values
-
ROLE_CUSTOMERGROUP
public static final java.lang.String ROLE_CUSTOMERGROUP
- See Also:
- Constant Field Values
-
ROLE_CUSTOMERMANAGERGROUP
public static final java.lang.String ROLE_CUSTOMERMANAGERGROUP
- See Also:
- Constant Field Values
-
ROLE_TRUSTED_CLIENT
public static final java.lang.String ROLE_TRUSTED_CLIENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
doFilterInternal
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, java.io.IOException- Specified by:
doFilterInternalin classorg.springframework.web.filter.OncePerRequestFilter- Throws:
javax.servlet.ServletExceptionjava.io.IOException
-
hasRole
protected boolean hasRole(java.lang.String role, org.springframework.security.core.Authentication auth)
-
setCurrentUser
protected void setCurrentUser(java.lang.String id)
-
setCurrentUser
protected void setCurrentUser(UserModel user)
-
setCurrentUserForCustomerGroupRole
protected void setCurrentUserForCustomerGroupRole(java.lang.String principal, java.lang.String userID)
-
getUserForValidProperty
protected java.util.Optional<UserModel> getUserForValidProperty(java.lang.String principal, java.lang.String propertyValue)
-
getAuth
protected org.springframework.security.core.Authentication getAuth()
-
getRegexp
protected java.lang.String getRegexp()
-
setRegexp
public void setRegexp(java.lang.String regexp)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getSessionService
protected SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getUserMatchingService
protected UserMatchingService getUserMatchingService()
-
setUserMatchingService
public void setUserMatchingService(UserMatchingService userMatchingService)
-
-