org.riotfamily.riot.security.session
Class LoginInterceptor

java.lang.Object
  extended by org.springframework.web.servlet.handler.HandlerInterceptorAdapter
      extended by org.riotfamily.common.web.interceptor.PathMatchingInterceptor
          extended by org.riotfamily.common.web.interceptor.OncePerRequestInterceptor
              extended by org.riotfamily.riot.security.session.AccessControlInterceptor
                  extended by org.riotfamily.riot.security.session.LoginInterceptor
All Implemented Interfaces:
RiotRuntimeAware, ServletContextAware, HandlerInterceptor

public class LoginInterceptor
extends AccessControlInterceptor
implements RiotRuntimeAware

HandlerInterceptor that sends a redirect to the login URL in case the user is not logged in.

Author:
Felix Gnass [fgnass at neteye dot de]

Constructor Summary
LoginInterceptor()
           
 
Method Summary
protected  boolean isAuthorized(HttpServletRequest request, HttpServletResponse response, RiotUser user)
          Returns true if a principal is set, otherwise false is returned and a redirect to the login form is sent.
 void setLoginUrl(String loginUrl)
           
 void setRiotRuntime(RiotRuntime runtime)
           
 
Methods inherited from class org.riotfamily.riot.security.session.AccessControlInterceptor
afterLastCompletion, preHandleOnce, setServletContext
 
Methods inherited from class org.riotfamily.common.web.interceptor.OncePerRequestInterceptor
afterCompletion, doPreHandle
 
Methods inherited from class org.riotfamily.common.web.interceptor.PathMatchingInterceptor
anyMatch, preHandle, setExcludes, setIncludes, setIncludesOverwriteExcludes, setPathMatcher
 
Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
postHandle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginInterceptor

public LoginInterceptor()
Method Detail

setLoginUrl

public void setLoginUrl(String loginUrl)

setRiotRuntime

public void setRiotRuntime(RiotRuntime runtime)
Specified by:
setRiotRuntime in interface RiotRuntimeAware

isAuthorized

protected boolean isAuthorized(HttpServletRequest request,
                               HttpServletResponse response,
                               RiotUser user)
                        throws Exception
Returns true if a principal is set, otherwise false is returned and a redirect to the login form is sent.

Overrides:
isAuthorized in class AccessControlInterceptor
Throws:
Exception