org.alfresco.repo.domain.permissions
Class AclDAOImpl

java.lang.Object
  extended by org.alfresco.repo.domain.permissions.AclDAOImpl
All Implemented Interfaces:
AclDAO

public class AclDAOImpl
extends java.lang.Object
implements AclDAO

DAO to manage ACL persistence Note: based on earlier AclDaoComponentImpl

Since:
3.4

Constructor Summary
AclDAOImpl()
           
 
Method Summary
 java.lang.Long createAccessControlList()
          Create a new ACL with default properties
 Acl createAccessControlList(AccessControlListProperties properties)
          Create a new ACL with the given properties.
 Acl createAccessControlList(AccessControlListProperties properties, java.util.List aces, java.lang.Long inherited)
          
 Acl createLayeredAcl(java.lang.Long indirectedAcl)
          
 java.util.List deleteAccessControlEntries(java.lang.Long id, AccessControlEntry pattern)
          Delete some locally set ACLs according to the pattern
 java.util.List deleteAccessControlEntries(java.lang.String authority)
          Delete all ACEs that reference this authority as no longer valid.
 java.util.List deleteAccessControlList(java.lang.Long id)
          Delete an ACL
 void deleteAclForNode(long aclId, boolean isAVMNode)
          
 java.util.List deleteInheritedAccessControlEntries(java.lang.Long id)
          Delete the ACEs in position > 0 (those not set directly on the ACL but inherited) No affect on any other acl
 java.util.List deleteLocalAccessControlEntries(java.lang.Long id)
          Delete the ACEs in position 0 (those set directly on the ACL and not inherited) Cleans up existing acls
 java.util.List disableInheritance(java.lang.Long id, boolean setInheritedOnAcl)
          Disable inheritance
 java.util.List enableInheritance(java.lang.Long id, java.lang.Long parent)
          Enable inheritance
 void fixSharedAcl(java.lang.Long shared, java.lang.Long defining)
          
 AccessControlList getAccessControlList(java.lang.Long id)
          Get an ACL (including entries)
 AccessControlListProperties getAccessControlListProperties(java.lang.Long id)
          Get the ACL properties
 Acl getAcl(java.lang.Long id)
          Get an ACL
 Acl getAclCopy(java.lang.Long toCopy, java.lang.Long toInheritFrom, ACLCopyMode mode)
          
 java.util.List getADMNodesByAcl(long aclEntityId, int maxResults)
          
 java.util.List getAVMNodesByAcl(long aclEntityId, int maxResults)
          
 AccessControlListProperties getDefaultProperties()
          Get the default ACL properties
 java.lang.Long getInheritedAccessControlList(java.lang.Long id)
          Get the id of the ACL inherited from the one given May return null if there is nothing to inherit -> OLD world where nodes have their own ACL and we walk the parent chain
 java.util.List mergeInheritedAccessControlList(java.lang.Long inherited, java.lang.Long target)
          Merge inherited ACEs in to target - the merged ACEs will go in at their current position +1
 void renameAuthority(java.lang.String before, java.lang.String after)
          
 java.util.List setAccessControlEntry(java.lang.Long id, AccessControlEntry ace)
          Add an access control entry
 void setAclCache(org.alfresco.repo.cache.SimpleCache aclCache)
          Set the ACL cache
 void setAclCrudDAO(AclCrudDAO aclCrudDAO)
           
 void setNodeDAO(NodeDAO nodeDAO)
           
 void setQnameDAO(QNameDAO qnameDAO)
           
 void setReadersCache(org.alfresco.repo.cache.SimpleCache readersCache)
           
 void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AclDAOImpl

public AclDAOImpl()
Method Detail

setQnameDAO

public void setQnameDAO(QNameDAO qnameDAO)

setTenantService

public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)

setAclCrudDAO

public void setAclCrudDAO(AclCrudDAO aclCrudDAO)

setNodeDAO

public void setNodeDAO(NodeDAO nodeDAO)

setAclCache

public void setAclCache(org.alfresco.repo.cache.SimpleCache aclCache)
Set the ACL cache

Parameters:
aclCache -

setReadersCache

public void setReadersCache(org.alfresco.repo.cache.SimpleCache readersCache)
Parameters:
readersCache - the readersCache to set

createAccessControlList

public java.lang.Long createAccessControlList()
Create a new ACL with default properties

Specified by:
createAccessControlList in interface AclDAO
See Also:
AclDAO.getDefaultProperties(), AclDAO.createAccessControlList(AccessControlListProperties)

getDefaultProperties

public AccessControlListProperties getDefaultProperties()
Get the default ACL properties

Specified by:
getDefaultProperties in interface AclDAO
Returns:
the default properties

createAccessControlList

public Acl createAccessControlList(AccessControlListProperties properties)
Create a new ACL with the given properties. Unset properties are assigned defaults.

Specified by:
createAccessControlList in interface AclDAO
Returns:
Acl

createAccessControlList

public Acl createAccessControlList(AccessControlListProperties properties,
                                   java.util.List aces,
                                   java.lang.Long inherited)

Specified by:
createAccessControlList in interface AclDAO
Returns:
Acl
See Also:
AclDAO.createAccessControlList(AccessControlListProperties)

deleteAccessControlEntries

public java.util.List deleteAccessControlEntries(java.lang.String authority)
Delete all ACEs that reference this authority as no longer valid. THIS DOES NOT CAUSE ANY ACL TO VERSION Used when deleting a user. No ACL is updated - the user has gone the aces and all related info is deleted.

Specified by:
deleteAccessControlEntries in interface AclDAO
Returns:
- the id of all ACLs affected

deleteAclForNode

public void deleteAclForNode(long aclId,
                             boolean isAVMNode)

Specified by:
deleteAclForNode in interface AclDAO

deleteAccessControlList

public java.util.List deleteAccessControlList(java.lang.Long id)
Delete an ACL

Specified by:
deleteAccessControlList in interface AclDAO
Returns:
- the id of all ACLs affected

deleteLocalAccessControlEntries

public java.util.List deleteLocalAccessControlEntries(java.lang.Long id)
Delete the ACEs in position 0 (those set directly on the ACL and not inherited) Cleans up existing acls

Specified by:
deleteLocalAccessControlEntries in interface AclDAO
Returns:
- the id of all ACLs affected

deleteInheritedAccessControlEntries

public java.util.List deleteInheritedAccessControlEntries(java.lang.Long id)
Delete the ACEs in position > 0 (those not set directly on the ACL but inherited) No affect on any other acl

Specified by:
deleteInheritedAccessControlEntries in interface AclDAO
Returns:
- the id of all ACLs affected

deleteAccessControlEntries

public java.util.List deleteAccessControlEntries(java.lang.Long id,
                                                 AccessControlEntry pattern)
Delete some locally set ACLs according to the pattern

Specified by:
deleteAccessControlEntries in interface AclDAO
pattern - - non null elements are used for the match
Returns:
- the id of all ACLs affected

getAcl

public Acl getAcl(java.lang.Long id)
Get an ACL

Specified by:
getAcl in interface AclDAO

getAccessControlListProperties

public AccessControlListProperties getAccessControlListProperties(java.lang.Long id)
Get the ACL properties

Specified by:
getAccessControlListProperties in interface AclDAO
Returns:
- the id of all ACLs affected

getAccessControlList

public AccessControlList getAccessControlList(java.lang.Long id)
Get an ACL (including entries)

Specified by:
getAccessControlList in interface AclDAO

getInheritedAccessControlList

public java.lang.Long getInheritedAccessControlList(java.lang.Long id)
Get the id of the ACL inherited from the one given May return null if there is nothing to inherit -> OLD world where nodes have their own ACL and we walk the parent chain

Specified by:
getInheritedAccessControlList in interface AclDAO

mergeInheritedAccessControlList

public java.util.List mergeInheritedAccessControlList(java.lang.Long inherited,
                                                      java.lang.Long target)
Merge inherited ACEs in to target - the merged ACEs will go in at their current position +1

Specified by:
mergeInheritedAccessControlList in interface AclDAO

setAccessControlEntry

public java.util.List setAccessControlEntry(java.lang.Long id,
                                            AccessControlEntry ace)
Add an access control entry

Specified by:
setAccessControlEntry in interface AclDAO

enableInheritance

public java.util.List enableInheritance(java.lang.Long id,
                                        java.lang.Long parent)
Enable inheritance

Specified by:
enableInheritance in interface AclDAO

disableInheritance

public java.util.List disableInheritance(java.lang.Long id,
                                         boolean setInheritedOnAcl)
Disable inheritance

Specified by:
disableInheritance in interface AclDAO

getAclCopy

public Acl getAclCopy(java.lang.Long toCopy,
                      java.lang.Long toInheritFrom,
                      ACLCopyMode mode)

Specified by:
getAclCopy in interface AclDAO

getAVMNodesByAcl

public java.util.List getAVMNodesByAcl(long aclEntityId,
                                       int maxResults)

Specified by:
getAVMNodesByAcl in interface AclDAO

getADMNodesByAcl

public java.util.List getADMNodesByAcl(long aclEntityId,
                                       int maxResults)

Specified by:
getADMNodesByAcl in interface AclDAO

createLayeredAcl

public Acl createLayeredAcl(java.lang.Long indirectedAcl)

Specified by:
createLayeredAcl in interface AclDAO

renameAuthority

public void renameAuthority(java.lang.String before,
                            java.lang.String after)

Specified by:
renameAuthority in interface AclDAO

fixSharedAcl

public void fixSharedAcl(java.lang.Long shared,
                         java.lang.Long defining)

Specified by:
fixSharedAcl in interface AclDAO


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.