|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.chain.AbstractAuthorizeAction
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.
Field Summary | |
private java.lang.String |
actionConfigKey
|
private java.lang.String |
actionServletKey
|
private static org.apache.commons.logging.Log |
log
|
Constructor Summary | |
AbstractAuthorizeAction()
|
Method Summary | |
boolean |
execute(org.apache.commons.chain.Context context)
Determine whether the requested action is authorized for the current user. |
java.lang.String |
getActionConfigKey()
Return the context attribute key under which the ActionConfig for the currently selected application
action is stored. |
java.lang.String |
getActionServletKey()
Return the context attribute key under which the ActionServlet for the currently selected application
action is stored. |
protected abstract boolean |
isAuthorized(org.apache.commons.chain.Context context,
java.lang.String[] roles,
org.apache.struts.config.ActionConfig actionConfig)
Determine if the action is authorized for the given roles. |
void |
setActionConfigKey(java.lang.String actionConfigKey)
Set the context attribute key under which the ActionConfig for the currently selected application
action is stored. |
void |
setActionServletKey(java.lang.String actionServletKey)
Set the context attribute key under which the ActionServlet for the currently selected application
action is stored. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String actionConfigKey
private java.lang.String actionServletKey
private static final org.apache.commons.logging.Log log
Constructor Detail |
public AbstractAuthorizeAction()
Method Detail |
public java.lang.String getActionConfigKey()
Return the context attribute key under which the
ActionConfig
for the currently selected application
action is stored.
public void setActionConfigKey(java.lang.String actionConfigKey)
Set the context attribute key under which the
ActionConfig
for the currently selected application
action is stored.
actionConfigKey
- The new context attribute keypublic java.lang.String getActionServletKey()
Return the context attribute key under which the
ActionServlet
for the currently selected application
action is stored.
public void setActionServletKey(java.lang.String actionServletKey)
Set the context attribute key under which the
ActionServlet
for the currently selected application
action is stored.
actionServletKey
- The new context attribute keypublic boolean execute(org.apache.commons.chain.Context context) throws java.lang.Exception
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.
execute
in interface org.apache.commons.chain.Command
context
- The Context
for the current request
false
if the user is authorized for the selected
action, else true
to abort processing.
java.lang.Exception
protected abstract boolean isAuthorized(org.apache.commons.chain.Context context, java.lang.String[] roles, org.apache.struts.config.ActionConfig actionConfig) throws java.lang.Exception
Determine if the action is authorized for the given roles.
context
- The Context
for the current requestroles
- An array of valid roles for this requestactionConfig
- The current action mapping
true
if the request is authorized, else
false
java.lang.Exception
- If the action cannot be tested for authorization
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |