|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.ramapuram.thomas.webapp.interceptor.UserRoleAuthorizationInterceptor
public class UserRoleAuthorizationInterceptor
Security interceptor checks to see if users are in the specified roles before proceeding. Similar to Spring's UserRoleAuthorizationInterceptor.
org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor,
Serialized Form| Constructor Summary | |
|---|---|
UserRoleAuthorizationInterceptor()
|
|
| Method Summary | |
|---|---|
void |
destroy()
This method currently does nothing. |
protected void |
handleNotAuthorized(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle a request that is not authorized according to this interceptor. |
void |
init()
This method currently does nothing. |
java.lang.String |
intercept(com.opensymphony.xwork2.ActionInvocation invocation)
Intercept the action invocation and check to see if the user has the proper role. |
void |
setAuthorizedRoles(java.lang.String[] authorizedRoles)
Set the roles that this interceptor should treat as authorized. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UserRoleAuthorizationInterceptor()
| Method Detail |
|---|
public java.lang.String intercept(com.opensymphony.xwork2.ActionInvocation invocation)
throws java.lang.Exception
intercept in interface com.opensymphony.xwork2.interceptor.Interceptorinvocation - the current action invocation
java.lang.Exception - when setting the error on the response failspublic final void setAuthorizedRoles(java.lang.String[] authorizedRoles)
authorizedRoles - array of role names
protected void handleNotAuthorized(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
This method can be overridden to write a custom message, forward or redirect to some error page or login page, or throw a ServletException.
request - current HTTP requestresponse - current HTTP response
javax.servlet.ServletException - if there is an internal error
java.io.IOException - in case of an I/O error when writing the responsepublic void destroy()
destroy in interface com.opensymphony.xwork2.interceptor.Interceptorpublic void init()
init in interface com.opensymphony.xwork2.interceptor.Interceptor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||