|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.auth.ApplicationUtil
public class ApplicationUtil
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();
Field Summary | |
---|---|
protected Context |
context
The Avalon context. |
Constructor Summary | |
---|---|
ApplicationUtil()
|
Method Summary | |
---|---|
void |
contextualize(Context aContext)
|
Application |
getApplication()
Return the current application. |
static Application |
getApplication(Map objectModel)
Return the current application. |
Object |
getData()
Return the current user data. |
static Object |
getData(Map objectModel)
Return the current user data. |
User |
getUser()
Return the current user. |
static User |
getUser(Map objectModel)
Return the current user. |
boolean |
isUserInRole(User user,
String role)
Checks if the user has the given role. |
static boolean |
isUserInRole(User user,
String role,
Map objectModel)
Checks if the user has the given role. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Context context
Constructor Detail |
---|
public ApplicationUtil()
Method Detail |
---|
public void contextualize(Context aContext) throws ContextException
contextualize
in interface Contextualizable
ContextException
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)
public static User getUser(Map objectModel)
objectModel
- The object model of the current request.
public static Application getApplication(Map objectModel)
objectModel
- The object model of the current request.
public static Object getData(Map objectModel)
objectModel
- The object model of the current request.
public static boolean isUserInRole(User user, String role, Map objectModel)
User.isUserInRole(String)
is invoked. If the result is false,
the Request.isUserInRole(java.lang.String)
is called.
user
- The user to test.role
- The role.objectModel
- The Cocoon object model.
public User getUser()
public Application getApplication()
public Object getData()
public boolean isUserInRole(User user, String role)
User.isUserInRole(String)
is invoked. If the result is false,
the Request.isUserInRole(java.lang.String)
is called.
user
- The user to test.role
- The role.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |