org.apache.struts.chain.commands.servlet
Class AuthorizeAction

java.lang.Object
  extended by org.apache.struts.chain.commands.ActionCommandBase
      extended by org.apache.struts.chain.commands.AbstractAuthorizeAction
          extended by org.apache.struts.chain.commands.servlet.AuthorizeAction
All Implemented Interfaces:
org.apache.commons.chain.Command, ActionCommand

public class AuthorizeAction
extends AbstractAuthorizeAction

Determine if the action is authorized for the given roles.

Version:
$Rev: 471754 $ $Date: 2005-11-12 13:01:44 -0500 (Sat, 12 Nov 2005) $

Field Summary
 
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
 
Constructor Summary
AuthorizeAction()
           
 
Method Summary
protected  String getErrorMessage(ActionContext context, ActionConfig actionConfig)
           Retrieve error message from context.
protected  boolean isAuthorized(ActionContext context, String[] roles, ActionConfig mapping)
          Determine if the action is authorized for the given roles.
 
Methods inherited from class org.apache.struts.chain.commands.AbstractAuthorizeAction
execute, isAuthorizationRequired
 
Methods inherited from class org.apache.struts.chain.commands.ActionCommandBase
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorizeAction

public AuthorizeAction()
Method Detail

isAuthorized

protected boolean isAuthorized(ActionContext context,
                               String[] roles,
                               ActionConfig mapping)
                        throws Exception
Description copied from class: AbstractAuthorizeAction

Determine if the action is authorized for the given roles.

Specified by:
isAuthorized in class AbstractAuthorizeAction
Parameters:
context - The Context for the current request
roles - An array of valid roles for this request
mapping - The current action mapping
Returns:
true if the request is authorized, else false
Throws:
UnauthorizedActionException - If the logic determines that the request is not authorized but does not wish to rely upon the default mechanism reporting the error.
Exception - If the action cannot be tested for authorization

getErrorMessage

protected String getErrorMessage(ActionContext context,
                                 ActionConfig actionConfig)
Description copied from class: AbstractAuthorizeAction

Retrieve error message from context.

Specified by:
getErrorMessage in class AbstractAuthorizeAction
Parameters:
context - The Context for the current request
actionConfig - The current action mapping
Returns:
error message


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.