|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.web.portlet.handler.HandlerInterceptorAdapter
org.springframework.web.portlet.handler.UserRoleAuthorizationInterceptor
public class UserRoleAuthorizationInterceptor
Interceptor that checks the authorization of the current user via the user's roles, as evaluated by PortletRequest's isUserInRole method.
PortletRequest.isUserInRole(java.lang.String)| Constructor Summary | |
|---|---|
UserRoleAuthorizationInterceptor()
|
|
| Method Summary | |
|---|---|
protected void |
handleNotAuthorized(javax.portlet.PortletRequest request,
javax.portlet.PortletResponse response,
Object handler)
Handle a request that is not authorized according to this interceptor. |
boolean |
preHandle(javax.portlet.PortletRequest request,
javax.portlet.PortletResponse response,
Object handler)
Default callback that all "pre*" methods delegate to. |
void |
setAuthorizedRoles(String[] authorizedRoles)
Set the roles that this interceptor should treat as authorized. |
| Methods inherited from class org.springframework.web.portlet.handler.HandlerInterceptorAdapter |
|---|
afterActionCompletion, afterCompletion, afterEventCompletion, afterRenderCompletion, afterResourceCompletion, postHandleRender, postHandleResource, preHandleAction, preHandleEvent, preHandleRender, preHandleResource |
| 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 final void setAuthorizedRoles(String[] authorizedRoles)
authorizedRoles - array of role names
public final boolean preHandle(javax.portlet.PortletRequest request,
javax.portlet.PortletResponse response,
Object handler)
throws javax.portlet.PortletException,
IOException
HandlerInterceptorAdapterThis implementation always returns true.
preHandle in class HandlerInterceptorAdapterjavax.portlet.PortletException
IOException
protected void handleNotAuthorized(javax.portlet.PortletRequest request,
javax.portlet.PortletResponse response,
Object handler)
throws javax.portlet.PortletException,
IOException
This method can be overridden to write a custom message, forward or redirect to some error page or login page, or throw a PortletException.
request - current portlet requestresponse - current portlet responsehandler - chosen handler to execute, for type and/or instance evaluation
javax.portlet.PortletException - if there is an internal error
IOException - in case of an I/O error when writing the response
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||