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_SUFFIX

    Fields inherited from class org.springframework.web.filter.GenericFilterBean

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    TmaAllowedPrincipalFilter(de.hybris.platform.servicelayer.config.ConfigurationService configurationService, String regexp, String regexpProductApi, de.hybris.platform.servicelayer.session.SessionService sessionService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doFilterInternal(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, javax.servlet.FilterChain filterChain)
     
    protected de.hybris.platform.servicelayer.config.ConfigurationService
     
    protected Matcher
    getMatcher(javax.servlet.http.HttpServletRequest request, String regexp)
    Returns the string that matches the regular expression from the URL.
    protected de.hybris.platform.servicelayer.session.SessionService
     
    protected boolean
    Checks if the authorized user has admin roles.
    protected boolean
    matchesUrl(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, shouldNotFilterErrorDispatch

    Methods inherited from class org.springframework.web.filter.GenericFilterBean

    addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TmaAllowedPrincipalFilter

      public TmaAllowedPrincipalFilter(de.hybris.platform.servicelayer.config.ConfigurationService configurationService, String regexp, String regexpProductApi, de.hybris.platform.servicelayer.session.SessionService sessionService)
  • 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:
      doFilterInternal in class org.springframework.web.filter.OncePerRequestFilter
      Throws:
      javax.servlet.ServletException
      IOException
    • matchesUrl

      protected boolean matchesUrl(javax.servlet.http.HttpServletRequest request, String regexp)
      Checks if the URL matches the provided regular expression.
      Parameters:
      request - The HTTP request
      regexp - The regular expression
      Returns:
      True if the regular expression matches the url, otherwise false
    • getMatcher

      protected Matcher getMatcher(javax.servlet.http.HttpServletRequest request, String regexp)
      Returns the string that matches the regular expression from the URL.
      Parameters:
      request - The HTTP request
      regexp - 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()