Class TmaAllowedPrincipalFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
de.hybris.platform.b2ctelcoocc.filters.TmaAllowedPrincipalFilter
- 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 TmaAllowedPrincipalFilter
extends org.springframework.web.filter.OncePerRequestFilter
Filter responsible for updating the allowed principal flag for the current user.
- Since:
- 2105
-
Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIXFields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
ConstructorsConstructorDescriptionTmaAllowedPrincipalFilter(de.hybris.platform.servicelayer.config.ConfigurationService configurationService, String regexp, String regexpProductApi, de.hybris.platform.servicelayer.session.SessionService sessionService) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoFilterInternal(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, javax.servlet.FilterChain filterChain) protected de.hybris.platform.servicelayer.config.ConfigurationServiceprotected MatchergetMatcher(javax.servlet.http.HttpServletRequest request, String regexp) Returns the string that matches the regular expression from the URL.protected de.hybris.platform.servicelayer.session.SessionServiceprotected booleanChecks if the authorized user has admin roles.protected booleanmatchesUrl(javax.servlet.http.HttpServletRequest request, String regexp) Checks if the URL matches the provided regular expression.Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
TmaAllowedPrincipalFilter
-
-
Method Details
-
doFilterInternal
protected void doFilterInternal(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, IOException - Specified by:
doFilterInternalin classorg.springframework.web.filter.OncePerRequestFilter- Throws:
javax.servlet.ServletExceptionIOException
-
matchesUrl
Checks if the URL matches the provided regular expression.- Parameters:
request- The HTTP requestregexp- The regular expression- Returns:
- True if the regular expression matches the url, otherwise false
-
getMatcher
Returns the string that matches the regular expression from the URL.- Parameters:
request- The HTTP requestregexp- The regular expression- Returns:
- The matched string
-
hasAdminRole
protected boolean hasAdminRole()Checks if the authorized user has admin roles.- Returns:
- True if the authorized user has admin role, otherwise false
-
getConfigurationService
protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService() -
getSessionService
protected de.hybris.platform.servicelayer.session.SessionService getSessionService()
-