org.apache.jackrabbit.core.security.authorization
Class UnmodifiableAccessControlList

java.lang.Object
  extended by org.apache.jackrabbit.core.security.authorization.UnmodifiableAccessControlList
All Implemented Interfaces:
AccessControlList, AccessControlPolicy, JackrabbitAccessControlList, JackrabbitAccessControlPolicy

public class UnmodifiableAccessControlList
extends Object
implements JackrabbitAccessControlList

An implementation of the AccessControlList interface that only allows for reading. The write methods (addAccessControlEntry and removeAccessControlEntry) throw an AccessControlException.


Constructor Summary
UnmodifiableAccessControlList(AccessControlList acl)
          Construct a new UnmodifiableAccessControlList
UnmodifiableAccessControlList(List<AccessControlEntry> accessControlEntries)
          Construct a new UnmodifiableAccessControlList
 
Method Summary
 boolean addAccessControlEntry(Principal principal, Privilege[] privileges)
           
 boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow)
           
 boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String,Value> restrictions)
           
 AccessControlEntry[] getAccessControlEntries()
           
 String getPath()
           
 String[] getRestrictionNames()
           
 int getRestrictionType(String restrictionName)
           
 boolean isEmpty()
           
 void orderBefore(AccessControlEntry srcEntry, AccessControlEntry destEntry)
           
 void removeAccessControlEntry(AccessControlEntry ace)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnmodifiableAccessControlList

public UnmodifiableAccessControlList(AccessControlList acl)
                              throws RepositoryException
Construct a new UnmodifiableAccessControlList

Parameters:
acl - The AccessControlList to be wrapped in order to prevent it's modification.
Throws:
RepositoryException - The the entries cannot be retrieved from the specified AccessControlList.

UnmodifiableAccessControlList

public UnmodifiableAccessControlList(List<AccessControlEntry> accessControlEntries)
Construct a new UnmodifiableAccessControlList

Parameters:
accessControlEntries - A list of access control entries.
Method Detail

getAccessControlEntries

public AccessControlEntry[] getAccessControlEntries()
                                             throws RepositoryException
Specified by:
getAccessControlEntries in interface AccessControlList
Throws:
RepositoryException
See Also:
AccessControlList.getAccessControlEntries()

addAccessControlEntry

public boolean addAccessControlEntry(Principal principal,
                                     Privilege[] privileges)
                              throws AccessControlException,
                                     RepositoryException
Specified by:
addAccessControlEntry in interface AccessControlList
Throws:
AccessControlException
RepositoryException
See Also:
AccessControlList.addAccessControlEntry(Principal, Privilege[])

removeAccessControlEntry

public void removeAccessControlEntry(AccessControlEntry ace)
                              throws AccessControlException,
                                     RepositoryException
Specified by:
removeAccessControlEntry in interface AccessControlList
Throws:
AccessControlException
RepositoryException
See Also:
AccessControlList.removeAccessControlEntry(AccessControlEntry)

getRestrictionNames

public String[] getRestrictionNames()
Specified by:
getRestrictionNames in interface JackrabbitAccessControlList

getRestrictionType

public int getRestrictionType(String restrictionName)
Specified by:
getRestrictionType in interface JackrabbitAccessControlList

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface JackrabbitAccessControlList

size

public int size()
Specified by:
size in interface JackrabbitAccessControlList

addEntry

public boolean addEntry(Principal principal,
                        Privilege[] privileges,
                        boolean isAllow)
                 throws AccessControlException
Specified by:
addEntry in interface JackrabbitAccessControlList
Throws:
AccessControlException

addEntry

public boolean addEntry(Principal principal,
                        Privilege[] privileges,
                        boolean isAllow,
                        Map<String,Value> restrictions)
                 throws AccessControlException
Specified by:
addEntry in interface JackrabbitAccessControlList
Throws:
AccessControlException

orderBefore

public void orderBefore(AccessControlEntry srcEntry,
                        AccessControlEntry destEntry)
                 throws AccessControlException
Specified by:
orderBefore in interface JackrabbitAccessControlList
Throws:
AccessControlException

getPath

public String getPath()
Specified by:
getPath in interface JackrabbitAccessControlPolicy


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