org.apache.jackrabbit.core.security.authorization
Interface AccessControlProvider

All Known Implementing Classes:
AbstractAccessControlProvider, ACLProvider, ACLProvider, CombinedProvider, UserAccessControlProvider

public interface AccessControlProvider

The AccessControlProvider is used to provide access control policy and entry objects that apply to an item in a single workspace. The provider is bound to a system session in contrast to the AccessControlManager that is bound to a specific session/subject.

Please note following additional special conditions:

See Also:
AccessControlProviderFactory

Method Summary
 boolean canAccessRoot(Set principals)
          Returns true if the given set of principals can access the root node of the workspace this provider has been built for; false otherwise.
 void close()
          Closes this provider when it is no longer used by the respective workspace and release resources bound by this provider.
 CompiledPermissions compilePermissions(Set principals)
          Compiles the effective policy for the specified set of Principals.
 AccessControlEditor getEditor(Session session)
          Returns an AccessControlEditor for the given Session object or null if the implementation does not support editing of access control policies.
 AccessControlPolicy[] getEffectivePolicies(Path absPath)
          Returns the effective policies for the node at the given absPath.
 void init(Session systemSession, Map configuration)
          Allows the AccessControlProviderFactory to pass a session and configuration parameters to the AccessControlProvider.
 

Method Detail

init

void init(Session systemSession,
          Map configuration)
          throws RepositoryException
Allows the AccessControlProviderFactory to pass a session and configuration parameters to the AccessControlProvider.

Parameters:
systemSession - System session.
configuration - Configuration used to initialize this provider.
Throws:
RepositoryException - If an error occurs.

close

void close()
Closes this provider when it is no longer used by the respective workspace and release resources bound by this provider.


getEffectivePolicies

AccessControlPolicy[] getEffectivePolicies(Path absPath)
                                           throws ItemNotFoundException,
                                                  RepositoryException
Returns the effective policies for the node at the given absPath.

Parameters:
absPath - an absolute path.
Returns:
The effective policies that apply at absPath or an empty array if the implementation cannot determine the effective policy at the given path.
Throws:
ItemNotFoundException - If no Node with the specified absPath exists.
RepositoryException - If another error occurs.
See Also:
AccessControlManager.getEffectivePolicies(String)

getEditor

AccessControlEditor getEditor(Session session)
                              throws RepositoryException
Returns an AccessControlEditor for the given Session object or null if the implementation does not support editing of access control policies.

Parameters:
session - The editing session.
Returns:
the ACL editor or null.
Throws:
RepositoryException - If an error occurs.

compilePermissions

CompiledPermissions compilePermissions(Set principals)
                                       throws RepositoryException
Compiles the effective policy for the specified set of Principals.

Parameters:
principals - Set of principals to compile the permissions for. If the order of evaluating permissions for principals is meaningful, the caller is adviced to pass a Set that respects the order of insertion.
Returns:
The effective, compiled CompiledPolicy that applies for the specified set of principals.
Throws:
RepositoryException - If an error occurs.

canAccessRoot

boolean canAccessRoot(Set principals)
                      throws RepositoryException
Returns true if the given set of principals can access the root node of the workspace this provider has been built for; false otherwise.

Parameters:
principals - Set of principals to be tested for being allowed to access the root node.
Returns:
true if the given set of principals can access the root node of the workspace this provider has been built for; false otherwise.
Throws:
RepositoryException - If an error occurs.


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.