| java.lang.Object org.apache.struts.chain.commands.ActionCommandBase org.apache.struts.chain.commands.AbstractAuthorizeAction
All known Subclasses: org.apache.struts.chain.commands.servlet.AuthorizeAction,
AbstractAuthorizeAction | abstract public class AbstractAuthorizeAction extends ActionCommandBase (Code) | | Determine whether the requested action is authorized for the current
user. If not, abort chain processing and perferably, return an error
message of some kind.
version: $Rev: 481115 $ $Date: 2005-11-12 13:01:44 -0500 (Sat, 12 Nov 2005) version: $ |
execute | public boolean execute(ActionContext actionCtx) throws Exception(Code) | | Determine whether the requested action is authorized for the current
user. If not, abort chain processing and perferably, return an error
message of some kind.
Parameters: actionCtx - The Context for the current request false if the user is authorized for the selectedaction, else true to abort processing. throws: UnauthorizedActionException - if authorization fails or if an error is encountered in the course of performing the authorization. |
getErrorMessage | abstract protected String getErrorMessage(ActionContext context, ActionConfig actionConfig)(Code) | | Retrieve error message from context.
Parameters: context - The Context for the current request Parameters: actionConfig - The current action mapping error message |
isAuthorizationRequired | protected boolean isAuthorizationRequired(ActionConfig actionConfig)(Code) | | Must authorization rules be consulted? The base implementation
returns true if the given ActionConfig has
one or more roles defined.
Parameters: actionConfig - the current ActionConfig object true if the isAuthorized method should beconsulted. |
isAuthorized | abstract protected boolean isAuthorized(ActionContext context, String[] roles, ActionConfig actionConfig) throws Exception(Code) | | Determine if the action is authorized for the given roles.
Parameters: context - The Context for the current request Parameters: roles - An array of valid roles for this request Parameters: actionConfig - The current action mapping true if the request is authorized, elsefalse 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. throws: Exception - If the action cannot be tested for authorization |
|
|