com.sptci.auth
Class AuthorisationFilter
java.lang.Object
com.sptci.auth.Filter
com.sptci.auth.AuthorisationFilter
- All Implemented Interfaces:
- Filter
public class AuthorisationFilter
- extends Filter
A filter that implements authorisation based on group membership.
Copyright 2006 Sans Pareil Technologies, Inc.
- Version:
- $Id: AuthorisationFilter.java 4553 2008-12-24 10:34:16Z rakesh $
- Author:
- Rakesh Vidyadharan 2006-11-14
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuthorisationFilter
public AuthorisationFilter()
init
public void init(FilterConfig filterConfig)
throws ServletException
- Over-ridden to initialise
authoriser and groups.
- Specified by:
init in interface Filter- Overrides:
init in class Filter
- Parameters:
filterConfig - - A reference to the configuration object
used by the servlet container to pass information to the filter.
- Throws:
ServletException - - If an exception is encountered while
fetching the initialisation parameters from the specified
filterConfig object reference.
doFilter
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws IOException,
ServletException
- Implementation of the filter action. Look up the user attribute
from the request and check group membership.
- Specified by:
doFilter in interface Filter- Overrides:
doFilter in class Filter
- Throws:
IOException
ServletException- See Also:
Authoriser.checkAuthorisation(com.sptci.auth.User, java.lang.String[])
displayError
protected void displayError(HttpServletResponse response)
throws ServletException,
IOException
- Send back an error page to the client if an un-authorised access
was attempted.
- Parameters:
response - The servlet response object.
- Throws:
ServletException - If a servlet exception is raised.
IOException - If errors are encountered while writing the
data.