org.apache.lenya.cms.ac.usecase
Class UsecaseAuthorizer

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.ac.usecase.UsecaseAuthorizer
All Implemented Interfaces:
org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.parameters.Parameterizable, org.apache.avalon.framework.service.Serviceable, Authorizer

public class UsecaseAuthorizer
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements Authorizer, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.parameters.Parameterizable

Authorizer for usecases.

Version:
$Id: UsecaseAuthorizer.java 473841 2006-11-12 00:46:38Z gregor $

Field Summary
static java.lang.String CONFIGURATION_FILE
           
static java.lang.String PARAMETER_CONFIGURATION
           
static java.lang.String TYPE
           
static java.lang.String USECASE_PARAMETER
           
 
Fields inherited from interface org.apache.lenya.ac.Authorizer
ROLE
 
Constructor Summary
UsecaseAuthorizer()
           
 
Method Summary
 boolean authorize(org.apache.cocoon.environment.Request request)
          Authorizes an identity at a URL.
 boolean authorizeUsecase(java.lang.String usecase, Role[] roles, Publication publication)
          Authorizes a usecase.
 boolean authorizeUsecase(java.lang.String usecase, Role[] roles, java.lang.String configurationUri)
          Authorizes a usecase.
 void dispose()
           
 SourceCache getCache()
          Returns the configuration source cache.
 java.lang.String getConfigurationURI()
          Returns the configuration URL.
protected  java.lang.String getConfigurationURI(Publication publication)
          Returns the source URI of the usecase role configuration file for a certain publication.
 void parameterize(org.apache.avalon.framework.parameters.Parameters parameters)
           
 void service(org.apache.avalon.framework.service.ServiceManager manager)
           
 
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

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

USECASE_PARAMETER

public static final java.lang.String USECASE_PARAMETER
See Also:
Constant Field Values

CONFIGURATION_FILE

public static final java.lang.String CONFIGURATION_FILE
See Also:
Constant Field Values

PARAMETER_CONFIGURATION

public static final java.lang.String PARAMETER_CONFIGURATION
See Also:
Constant Field Values
Constructor Detail

UsecaseAuthorizer

public UsecaseAuthorizer()
Method Detail

getCache

public SourceCache getCache()
Returns the configuration source cache.

Returns:
A source cache.

getConfigurationURI

protected java.lang.String getConfigurationURI(Publication publication)
Returns the source URI of the usecase role configuration file for a certain publication.

Parameters:
publication - The publication.
Returns:
A string representing a URI.

authorize

public boolean authorize(org.apache.cocoon.environment.Request request)
                  throws AccessControlException
Description copied from interface: Authorizer
Authorizes an identity at a URL.

Specified by:
authorize in interface Authorizer
Parameters:
request - The request.
Returns:
true if the identity is authorized, false otherwise.
Throws:
AccessControlException - when something went wrong.
See Also:
Authorizer.authorize(org.apache.cocoon.environment.Request)

authorizeUsecase

public boolean authorizeUsecase(java.lang.String usecase,
                                Role[] roles,
                                java.lang.String configurationUri)
                         throws AccessControlException
Authorizes a usecase.

Parameters:
usecase - The usecase ID.
roles - The roles of the current identity.
configurationUri - The URI to retrieve the policy configuration from.
Returns:
A boolean value.
Throws:
AccessControlException - 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)

dispose

public void dispose()
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable
See Also:
Disposable.dispose()

parameterize

public void parameterize(org.apache.avalon.framework.parameters.Parameters parameters)
                  throws org.apache.avalon.framework.parameters.ParameterException
Specified by:
parameterize in interface org.apache.avalon.framework.parameters.Parameterizable
Throws:
org.apache.avalon.framework.parameters.ParameterException
See Also:
Parameterizable.parameterize(org.apache.avalon.framework.parameters.Parameters)

getConfigurationURI

public java.lang.String getConfigurationURI()
Returns the configuration URL.

Returns:
The configuration URL.

authorizeUsecase

public boolean authorizeUsecase(java.lang.String usecase,
                                Role[] roles,
                                Publication publication)
                         throws AccessControlException
Authorizes a usecase.

Parameters:
usecase - The usecase to authorize.
roles - The roles of the identity.
publication - The publication.
Returns:
A boolean value.
Throws:
AccessControlException - when something went wrong.


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.