ModeShape Distribution 3.5.0.Final

org.modeshape.jcr.security.acl
Class JcrAccessControlList

java.lang.Object
  extended by org.modeshape.jcr.security.acl.JcrAccessControlList
All Implemented Interfaces:
AccessControlList, AccessControlPolicy

public class JcrAccessControlList
extends Object
implements AccessControlList

Resources based Access Control List implementation. ACLs are stored per node in a special child node called mode:acl. This node has a list of mode:{$principal_name} child nodes which has multi-value property permissions. Permissions are defined by JCR specifications. {node} {mode:AccessControllable} +mode:acl{mode:Acl} +user-name{mode:permission} -permissions {String}


Constructor Summary
JcrAccessControlList(AccessControlManagerImpl acm, String path)
          Creates new empty access control list.
 
Method Summary
 boolean addAccessControlEntry(Principal principal, Privilege[] privileges)
           
static JcrAccessControlList defaultAcl(AccessControlManagerImpl acm)
          Creates default Access Control List.
 boolean equals(Object other)
           
 AccessControlEntry[] getAccessControlEntries()
           
 Privilege[] getPrivileges(String username)
          Lists all privileges defined by this access list for the given user.
 boolean hasEntry(String name)
           
 int hashCode()
           
 boolean hasPrivileges(String username, Privilege[] privileges)
          Tests privileges for the given user.
 boolean isEmpty()
          Checks entries of this access control list.
 void removeAccessControlEntry(AccessControlEntry accessControlEntry)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcrAccessControlList

public JcrAccessControlList(AccessControlManagerImpl acm,
                            String path)
Creates new empty access control list.

Parameters:
acm - Access Control Manager managing this access list.
path - the path to which this access list is applied.
Method Detail

defaultAcl

public static JcrAccessControlList defaultAcl(AccessControlManagerImpl acm)
Creates default Access Control List.

Parameters:
acm - access control manager instance
Returns:
Access Control List with all permissions granted to everyone.

isEmpty

public boolean isEmpty()
Checks entries of this access control list.

Returns:
true if this access list does not have entries and false otherwise.

getAccessControlEntries

public AccessControlEntry[] getAccessControlEntries()
Specified by:
getAccessControlEntries in interface AccessControlList

addAccessControlEntry

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

removeAccessControlEntry

public void removeAccessControlEntry(AccessControlEntry accessControlEntry)
                              throws AccessControlException,
                                     RepositoryException
Specified by:
removeAccessControlEntry in interface AccessControlList
Throws:
AccessControlException
RepositoryException

hasPrivileges

public boolean hasPrivileges(String username,
                             Privilege[] privileges)
Tests privileges for the given user.

Parameters:
username - the name of the user
privileges - privileges for testing
Returns:
true if this access list contains all given privileges for the given user

getPrivileges

public Privilege[] getPrivileges(String username)
Lists all privileges defined by this access list for the given user.

Parameters:
username - the name of the user
Returns:
list of privilege objects.

hasEntry

public boolean hasEntry(String name)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

ModeShape Distribution 3.5.0.Final

Copyright © 2008-2013 JBoss, a division of Red Hat. All Rights Reserved.