Class SecurityUserCheckBeforeControllerHandler
java.lang.Object
de.hybris.platform.yacceleratorstorefront.interceptors.beforecontroller.SecurityUserCheckBeforeControllerHandler
- All Implemented Interfaces:
BeforeControllerHandler
public class SecurityUserCheckBeforeControllerHandler
extends 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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanbeforeController(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, String redirectPath) protected booleanisPreviewDataModelValid(javax.servlet.http.HttpServletRequest httpRequest) Checks whether there is a preview data setup for the current requestprotected booleanisUserDeactivated(UserModel userModel)
-
Constructor Details
-
SecurityUserCheckBeforeControllerHandler
public SecurityUserCheckBeforeControllerHandler()
-
-
Method Details
-
beforeController
public boolean beforeController(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.web.method.HandlerMethod handler) throws IOException Description 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:
IOException
-
invalidateSessionAndRedirect
protected void invalidateSessionAndRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String redirectPath) throws IOException - Throws:
IOException
-
isUserDeactivated
-
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
-