org.apache.lenya.ac
Interface PolicyManager

All Superinterfaces:
org.apache.avalon.framework.component.Component
All Known Subinterfaces:
InheritingPolicyManager

public interface PolicyManager
extends org.apache.avalon.framework.component.Component

A policy manager.

Version:
$Id: PolicyManager.java 479620 2006-11-27 14:02:13Z andreas $

Field Summary
static java.lang.String ROLE
          The Avalon role.
 
Method Summary
 void accreditableAdded(AccreditableManager manager, Accreditable accreditable)
          Called when an accreditable was added.
 void accreditableRemoved(AccreditableManager manager, Accreditable accreditable)
          Called when an accreditable was removed.
 Credential[] getCredentials(AccreditableManager controller, java.lang.String url)
          Return all credentials for this url
 Role[] getGrantedRoles(AccreditableManager accreditableManager, Identity identity, java.lang.String url)
          Returns all granted roles for a certain identity on a certain URL.
 Policy getPolicy(AccreditableManager controller, java.lang.String url)
          Returns the policy for a given page.
 

Field Detail

ROLE

static final java.lang.String ROLE
The Avalon role.

Method Detail

getPolicy

Policy getPolicy(AccreditableManager controller,
                 java.lang.String url)
                 throws AccessControlException
Returns the policy for a given page.

Parameters:
controller - The access controller.
url - The url inside the web application.
Returns:
The policy.
Throws:
AccessControlException - when something went wrong.

getGrantedRoles

Role[] getGrantedRoles(AccreditableManager accreditableManager,
                       Identity identity,
                       java.lang.String url)
                       throws AccessControlException
Returns all granted roles for a certain identity on a certain URL.

Parameters:
accreditableManager - The accreditable manager.
identity - The identity.
url - The URL.
Returns:
An array of roles.
Throws:
AccessControlException - if an error occurs.

getCredentials

Credential[] getCredentials(AccreditableManager controller,
                            java.lang.String url)
                            throws AccessControlException
Return all credentials for this url

Parameters:
controller - The Accreditable Manager
url - The AC url
Returns:
An array of credentials
Throws:
AccessControlException - when something went wrong.

accreditableAdded

void accreditableAdded(AccreditableManager manager,
                       Accreditable accreditable)
                       throws AccessControlException
Called when an accreditable was added. Used to create the admin interface policy. This method get invoked, when e.g. a new user is added. The user always should be able to edit her profile. Therefore the method normally grant inherit edit rights to the user profile page.

Parameters:
manager - The accreditable manager the accreditable belonged to.
accreditable - The accreditable that was removed.
Throws:
AccessControlException - when something went wrong.

accreditableRemoved

void accreditableRemoved(AccreditableManager manager,
                         Accreditable accreditable)
                         throws AccessControlException
Called when an accreditable was removed. Used to clean up the policies and to remove the admin interface policy.

Parameters:
manager - The accreditable manager the accreditable belonged to.
accreditable - The accreditable that was removed.
Throws:
AccessControlException - when something went wrong.


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