Class SecurityUserCheckBeforeControllerHandler
- java.lang.Object
-
- de.hybris.platform.yacceleratorstorefront.interceptors.beforecontroller.SecurityUserCheckBeforeControllerHandler
-
- All Implemented Interfaces:
BeforeControllerHandler
public class SecurityUserCheckBeforeControllerHandler extends java.lang.Object implements BeforeControllerHandler
Spring MVC interceptor that validates that the spring security user and the hybris session user are in sync. If the spring security user and the hybris session user are not in sync then the session is invalidated and the visitor is redirect to the homepage.
-
-
Constructor Summary
Constructors Constructor Description SecurityUserCheckBeforeControllerHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbeforeController(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.web.method.HandlerMethod handler)Called before the DispatcherServlet calls the controller.protected voidinvalidateSessionAndRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String redirectPath)protected booleanisPreviewDataModelValid(javax.servlet.http.HttpServletRequest httpRequest)Checks whether there is a preview data setup for the current requestprotected booleanisUserDeactivated(UserModel userModel)
-
-
-
Method Detail
-
beforeController
public boolean beforeController(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.web.method.HandlerMethod handler) throws java.io.IOExceptionDescription copied from interface:BeforeControllerHandlerCalled before the DispatcherServlet calls the controller.- Specified by:
beforeControllerin interfaceBeforeControllerHandler- Parameters:
request- current HTTP requestresponse- current HTTP response- Returns:
trueif the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.- Throws:
java.io.IOException
-
invalidateSessionAndRedirect
protected void invalidateSessionAndRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String redirectPath) throws java.io.IOException- Throws:
java.io.IOException
-
isUserDeactivated
protected boolean isUserDeactivated(UserModel userModel)
-
isPreviewDataModelValid
protected boolean isPreviewDataModelValid(javax.servlet.http.HttpServletRequest httpRequest)
Checks whether there is a preview data setup for the current request- Parameters:
httpRequest- current request- Returns:
- true whether is valid otherwise false
-
-