Class 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 Detail

      • 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
    • Constructor Detail

      • UserMatchingFilter

        public UserMatchingFilter()
    • 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:
        doFilterInternal in class org.springframework.web.filter.OncePerRequestFilter
        Throws:
        javax.servlet.ServletException
        java.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)
      • setSessionService

        public void setSessionService​(SessionService sessionService)
      • setUserMatchingService

        public void setUserMatchingService​(UserMatchingService userMatchingService)