| java.lang.Object org.apache.cocoon.auth.ApplicationUtil
ApplicationUtil | public class ApplicationUtil implements Contextualizable(Code) | | Utility class that can be used from flow script to access the different
application functions of Cocoon Authentication.
The easiest way to use this class in flow script is to create an instance
using cocoon.createObject():
var util = cocoon.createObject("org.apache.cocoon.auth.ApplicationUtil");
and then you can invoke one of the instance methods like
var user = util.getUser();
version: $Id: ApplicationUtil.java 502601 2007-02-02 13:15:47Z cziegeler $ |
Field Summary | |
protected Context | context The Avalon context. |
context | protected Context context(Code) | | The Avalon context.
|
contextualize | public void contextualize(Context aContext) throws ContextException(Code) | | See Also: org.apache.avalon.framework.context.Contextualizable.contextualize(org.apache.avalon.framework.context.Context) |
getApplication | public static Application getApplication(Map objectModel)(Code) | | Return the current application.
Parameters: objectModel - The object model of the current request. The current application or null. |
getApplication | public Application getApplication()(Code) | | Return the current application.
The current application or null. |
getData | public static Object getData(Map objectModel)(Code) | | Return the current user data.
Parameters: objectModel - The object model of the current request. The current user data or null. |
getData | public Object getData()(Code) | | Return the current user data.
The current user data or null. |
getUser | public static User getUser(Map objectModel)(Code) | | Return the current user.
Parameters: objectModel - The object model of the current request. The current user or null. |
getUser | public User getUser()(Code) | | Return the current user.
The current user or null. |
isUserInRole | public static boolean isUserInRole(User user, String role, Map objectModel)(Code) | | Checks if the user has the given role.
First
User.isUserInRole(String) is invoked. If the result is false,
the
Request.isUserInRole(java.lang.String) is called.
Parameters: user - The user to test. Parameters: role - The role. Parameters: objectModel - The Cocoon object model. This returns true, if the user has the role; otherwise false is returned. |
|
|