org.apache.lenya.cms.cocoon.components.modules.input
Class AccessControlModule

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.modules.input.AbstractInputModule
          extended by org.apache.lenya.cms.cocoon.components.modules.input.AccessControlModule
All Implemented Interfaces:
org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.components.modules.input.InputModule

public class AccessControlModule
extends org.apache.cocoon.components.modules.input.AbstractInputModule
implements org.apache.avalon.framework.service.Serviceable

Input module for access control attributes.

Attributes:


Field Summary
static java.lang.String GROUP_MANAGER
          GROUP_MANAGER The group manager
static java.lang.String IP_ADDRESS
          IP_ADDRESS The IP address
static java.lang.String IP_RANGE_MANAGER
          IP_RANGE_MANAGER The IP range manager
static java.lang.String ROLE_IDS
          ROLE_IDS The role ids
static java.lang.String ROLE_MANAGER
          ROLE_MANAGER The role manager
static java.lang.String SSL
          Returns if the current page is SSL protected (true|false).
static java.lang.String USER_EMAIL
          USER_EMAIL The user email, optional: provide the user ID after a colon
static java.lang.String USER_ID
          USER_ID The user id
static java.lang.String USER_MANAGER
          USER_MANAGER The user manager
static java.lang.String USER_NAME
          USER_NAME The user name, optional: provide the user ID after a colon
 
Fields inherited from class org.apache.cocoon.components.modules.input.AbstractInputModule
settings
 
Fields inherited from interface org.apache.cocoon.components.modules.input.InputModule
ROLE
 
Constructor Summary
AccessControlModule()
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attribute, org.apache.avalon.framework.configuration.Configuration modeConf, java.util.Map objectModel)
           
 java.util.Iterator getAttributeNames(org.apache.avalon.framework.configuration.Configuration modeConf, java.util.Map objectModel)
           
 java.lang.Object[] getAttributeValues(java.lang.String name, org.apache.avalon.framework.configuration.Configuration modeConf, java.util.Map objectModel)
           
protected  org.apache.lenya.ac.ItemManager getItemManager(org.apache.cocoon.environment.Request request, java.lang.String name)
          Returns the item manager for a certain name.
protected  org.apache.lenya.ac.User getUser(org.apache.cocoon.environment.Request request, java.lang.String[] parameters, org.apache.lenya.ac.Identity identity)
          Returns the user specified with parameter[1], falling back to the currently logged in user.
 void service(org.apache.avalon.framework.service.ServiceManager _manager)
           
 
Methods inherited from class org.apache.cocoon.components.modules.input.AbstractInputModule
configure, dispose
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_ID

public static final java.lang.String USER_ID
USER_ID The user id

See Also:
Constant Field Values

USER_NAME

public static final java.lang.String USER_NAME
USER_NAME The user name, optional: provide the user ID after a colon

See Also:
Constant Field Values

USER_EMAIL

public static final java.lang.String USER_EMAIL
USER_EMAIL The user email, optional: provide the user ID after a colon

See Also:
Constant Field Values

IP_ADDRESS

public static final java.lang.String IP_ADDRESS
IP_ADDRESS The IP address

See Also:
Constant Field Values

ROLE_IDS

public static final java.lang.String ROLE_IDS
ROLE_IDS The role ids

See Also:
Constant Field Values

USER_MANAGER

public static final java.lang.String USER_MANAGER
USER_MANAGER The user manager

See Also:
Constant Field Values

GROUP_MANAGER

public static final java.lang.String GROUP_MANAGER
GROUP_MANAGER The group manager

See Also:
Constant Field Values

ROLE_MANAGER

public static final java.lang.String ROLE_MANAGER
ROLE_MANAGER The role manager

See Also:
Constant Field Values

IP_RANGE_MANAGER

public static final java.lang.String IP_RANGE_MANAGER
IP_RANGE_MANAGER The IP range manager

See Also:
Constant Field Values

SSL

public static final java.lang.String SSL
Returns if the current page is SSL protected (true|false).

See Also:
Constant Field Values
Constructor Detail

AccessControlModule

public AccessControlModule()
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String attribute,
                                     org.apache.avalon.framework.configuration.Configuration modeConf,
                                     java.util.Map objectModel)
                              throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
getAttribute in interface org.apache.cocoon.components.modules.input.InputModule
Overrides:
getAttribute in class org.apache.cocoon.components.modules.input.AbstractInputModule
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
InputModule.getAttribute(java.lang.String, org.apache.avalon.framework.configuration.Configuration, java.util.Map)

getUser

protected org.apache.lenya.ac.User getUser(org.apache.cocoon.environment.Request request,
                                           java.lang.String[] parameters,
                                           org.apache.lenya.ac.Identity identity)
                                    throws org.apache.avalon.framework.configuration.ConfigurationException
Returns the user specified with parameter[1], falling back to the currently logged in user.

Parameters:
request - The request.
parameters - The parameters.
identity - The logged in identity.
Returns:
A user or null if no user is specified or logged in.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if an error occurs.

getAttributeNames

public java.util.Iterator getAttributeNames(org.apache.avalon.framework.configuration.Configuration modeConf,
                                            java.util.Map objectModel)
                                     throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
getAttributeNames in interface org.apache.cocoon.components.modules.input.InputModule
Overrides:
getAttributeNames in class org.apache.cocoon.components.modules.input.AbstractInputModule
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
InputModule.getAttributeNames(org.apache.avalon.framework.configuration.Configuration, java.util.Map)

getAttributeValues

public java.lang.Object[] getAttributeValues(java.lang.String name,
                                             org.apache.avalon.framework.configuration.Configuration modeConf,
                                             java.util.Map objectModel)
                                      throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
getAttributeValues in interface org.apache.cocoon.components.modules.input.InputModule
Overrides:
getAttributeValues in class org.apache.cocoon.components.modules.input.AbstractInputModule
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
InputModule.getAttributeValues(java.lang.String, org.apache.avalon.framework.configuration.Configuration, java.util.Map)

getItemManager

protected org.apache.lenya.ac.ItemManager getItemManager(org.apache.cocoon.environment.Request request,
                                                         java.lang.String name)
                                                  throws org.apache.avalon.framework.configuration.ConfigurationException
Returns the item manager for a certain name.

Parameters:
request - The request.
name - The name of the manager (USER_MANAGER, ROLE_MANAGER, GROUP_MANAGER, or IP_RANGE_MANAGER
Returns:
An item manager.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - when something went wrong.

service

public void service(org.apache.avalon.framework.service.ServiceManager _manager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)


Copyright $ Apache Software Foundation. All Rights Reserved.