org.apache.lenya.cms.ac
Class PolicyUtil

java.lang.Object
  extended by org.apache.lenya.cms.ac.PolicyUtil

public final class PolicyUtil
extends java.lang.Object

Policy utility class.


Constructor Summary
PolicyUtil()
           
 
Method Summary
static Role[] getRoles(org.apache.cocoon.environment.Request request)
          Fetches the stored roles from the request.
static User getUser(org.apache.avalon.framework.service.ServiceManager manager, java.lang.String webappUrl, java.lang.String userId, org.apache.avalon.framework.logger.Logger logger)
           
static User[] getUsersWithRole(org.apache.avalon.framework.service.ServiceManager manager, java.lang.String webappUrl, java.lang.String role, org.apache.avalon.framework.logger.Logger logger)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyUtil

public PolicyUtil()
Method Detail

getRoles

public static final Role[] getRoles(org.apache.cocoon.environment.Request request)
                             throws AccessControlException
Fetches the stored roles from the request.

Parameters:
request - The request.
Returns:
A role array.
Throws:
AccessControlException - If the request does not contain the roles list.

getUser

public static final User getUser(org.apache.avalon.framework.service.ServiceManager manager,
                                 java.lang.String webappUrl,
                                 java.lang.String userId,
                                 org.apache.avalon.framework.logger.Logger logger)
                          throws AccessControlException
Parameters:
manager - The service manager.
webappUrl - The web application URL.
userId - The user ID.
logger - The logger.
Returns:
A user.
Throws:
AccessControlException - if an error occurs.

getUsersWithRole

public static final User[] getUsersWithRole(org.apache.avalon.framework.service.ServiceManager manager,
                                            java.lang.String webappUrl,
                                            java.lang.String role,
                                            org.apache.avalon.framework.logger.Logger logger)
                                     throws AccessControlException
Parameters:
manager - The service manager.
webappUrl - The web application URL.
role - The ID of the role.
logger - The logger to use.
Returns:
All users which have the role on this URL.
Throws:
AccessControlException - if an error occurs.


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.