org.apache.struts.chain.commands.servlet
Class AuthorizeAction
java.lang.Object
org.apache.struts.chain.commands.ActionCommandBase
org.apache.struts.chain.commands.AbstractAuthorizeAction
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)
$
Fields inherited from interface org.apache.commons.chain.Command |
CONTINUE_PROCESSING, PROCESSING_COMPLETE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuthorizeAction
public AuthorizeAction()
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 requestroles
- An array of valid roles for this requestmapping
- 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 requestactionConfig
- The current action mapping
- Returns:
- error message
Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.