Class ACPImpl
- java.lang.Object
 - 
- org.nuxeo.ecm.core.api.security.impl.ACPImpl
 
 
- 
- All Implemented Interfaces:
 Serializable,Cloneable,ACP
public class ACPImpl extends Object implements ACP
The ACP implementation uses a cache used when calling getAccess().- See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringLEGACY_BEHAVIOR_PROPERTYConfigurationService property to enable legacy behavior. 
- 
Constructor Summary
Constructors Constructor Description ACPImpl() 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAccessRule(String aclName, ACE ace)booleanaddACE(String aclName, ACE ace)Add an ACE to the givenaclName.voidaddACL(int pos, ACL acl)voidaddACL(String afterMe, ACL acl)voidaddACL(ACL acl)This method must append the ACL and not insert it since it is used to append the inherited ACL which is the less significant ACL.booleanblockInheritance(String aclName, String username)Block the inheritance on the givenaclName.ACPImplclone()Return a recursive copy of the ACP sharing no mutable substructure with the originalAccessgetAccess(String[] principals, String[] permissions)Checks the access on the ACLs for each set of the given permissions and principals.AccessgetAccess(String principal, String permission)Check whether this ACP grant the given permission on the given user, denies it or doesn't specify a rule.static AccessgetAccess(ACE ace, String[] principals, String[] permissions)ACLgetACL(String name)ACL[]getACLs()ACLgetMergedACLs(String name)ACLgetOrCreateACL()ACLgetOrCreateACL(String name)String[]listUsernamesForAnyPermission(Set<String> perms)Returns the usernames granted to perform an operation based on a list of permissions.static ACLnewACL(String name)booleanremoveACE(String aclName, ACE ace)Remove an ACE on the givenaclName.booleanremoveACEsByUsername(String username)Remove all ACEs forusernameon the whole ACP.booleanremoveACEsByUsername(String aclName, String username)Remove all ACEs forusernameon the givenaclName.ACLremoveACL(String name)booleanreplaceACE(String aclName, ACE oldACE, ACE newACE)Replace theoldACEwithnewACEon the givenaclName, only if theoldACEexists.voidreplacePermission(String oldPerm, String newPerm)Replaces a permission with another in this ACP.voidsetRules(String aclName, UserEntry[] userEntries)Replaces the modifiable user entries (associated with the currentDocument) related to the ACP.voidsetRules(String aclName, UserEntry[] userEntries, boolean overwrite)Replaces the modifiable user entries (associated with the currentDocument) related to the ACP.voidsetRules(UserEntry[] userEntries)Replaces the modifiable user entries (associated with the currentDocument) related to the current ACP.voidsetRules(UserEntry[] userEntries, boolean overwrite)Replaces the modifiable user entries (associated with the currentDocument) related to the current ACP.booleanunblockInheritance(String aclName)Unblock the inheritance on the givenaclName.protected booleanuseLegacyBehavior() 
 - 
 
- 
- 
Field Detail
- 
LEGACY_BEHAVIOR_PROPERTY
public static final String LEGACY_BEHAVIOR_PROPERTY
ConfigurationService property to enable legacy behavior.- Since:
 - 10.2
 - See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
addACL
public void addACL(ACL acl)
This method must append the ACL and not insert it since it is used to append the inherited ACL which is the less significant ACL. 
- 
getMergedACLs
public ACL getMergedACLs(String name)
- Specified by:
 getMergedACLsin interfaceACP
 
- 
getAccess
public Access getAccess(String principal, String permission)
Description copied from interface:ACPCheck whether this ACP grant the given permission on the given user, denies it or doesn't specify a rule.This is checking only the ACLs on that ACP. Parents if any are not checked.
 
- 
getAccess
public Access getAccess(String[] principals, String[] permissions)
Description copied from interface:ACPChecks the access on the ACLs for each set of the given permissions and principals.This differs for an iterative check using getAccess(String principal, String permission) in the order of checks - so that in this case each ACE is fully checked against the given users and permissions before passing to the next ACE.
 
- 
getOrCreateACL
public ACL getOrCreateACL(String name)
- Specified by:
 getOrCreateACLin interfaceACP
 
- 
getOrCreateACL
public ACL getOrCreateACL()
- Specified by:
 getOrCreateACLin interfaceACP
 
- 
setRules
public void setRules(String aclName, UserEntry[] userEntries)
Description copied from interface:ACPReplaces the modifiable user entries (associated with the currentDocument) related to the ACP.Considers that all the passed entries are modifiable and attempts to set them as entries related to the current document.
 
- 
setRules
public void setRules(String aclName, UserEntry[] userEntries, boolean overwrite)
Description copied from interface:ACPReplaces the modifiable user entries (associated with the currentDocument) related to the ACP.Considers that all the passed entries are modifiable and attempts to set them as entries related to the current document.
 
- 
setRules
public void setRules(UserEntry[] userEntries)
Description copied from interface:ACPReplaces the modifiable user entries (associated with the currentDocument) related to the current ACP.Considers that all the passed entries are modifiable and attempts to set them as local entries related to the current document.
 
- 
setRules
public void setRules(UserEntry[] userEntries, boolean overwrite)
Description copied from interface:ACPReplaces the modifiable user entries (associated with the currentDocument) related to the current ACP.Considers that all the passed entries are modifiable and attempts to set them as local entries related to the current document.
The current behavior reset completely the current ACL.
 
- 
listUsernamesForAnyPermission
public String[] listUsernamesForAnyPermission(Set<String> perms)
Description copied from interface:ACPReturns the usernames granted to perform an operation based on a list of permissions.- Specified by:
 listUsernamesForAnyPermissionin interfaceACP- Parameters:
 perms- the list of permissions.- Returns:
 - a list of usernames
 
 
- 
clone
public ACPImpl clone()
Description copied from interface:ACPReturn a recursive copy of the ACP sharing no mutable substructure with the original 
- 
blockInheritance
public boolean blockInheritance(String aclName, String username)
Description copied from interface:ACPBlock the inheritance on the givenaclName.- Specified by:
 blockInheritancein interfaceACPusername- the user blocking the inheritance- Returns:
 - true if the ACP was changed.
 
 
- 
unblockInheritance
public boolean unblockInheritance(String aclName)
Description copied from interface:ACPUnblock the inheritance on the givenaclName.- Specified by:
 unblockInheritancein interfaceACP- Returns:
 - true if the ACP was changed.
 
 
- 
addACE
public boolean addACE(String aclName, ACE ace)
Description copied from interface:ACPAdd an ACE to the givenaclName. 
- 
replaceACE
public boolean replaceACE(String aclName, ACE oldACE, ACE newACE)
Description copied from interface:ACPReplace theoldACEwithnewACEon the givenaclName, only if theoldACEexists.The
newACEkeeps the same index asoldACE.- Specified by:
 replaceACEin interfaceACP- Returns:
 - true if the ACP was changed.
 
 
- 
removeACE
public boolean removeACE(String aclName, ACE ace)
Description copied from interface:ACPRemove an ACE on the givenaclName. 
- 
removeACEsByUsername
public boolean removeACEsByUsername(String aclName, String username)
Description copied from interface:ACPRemove all ACEs forusernameon the givenaclName.- Specified by:
 removeACEsByUsernamein interfaceACP- Returns:
 - true if the ACP was changed.
 
 
- 
removeACEsByUsername
public boolean removeACEsByUsername(String username)
Description copied from interface:ACPRemove all ACEs forusernameon the whole ACP.- Specified by:
 removeACEsByUsernamein interfaceACP- Returns:
 - true if the ACP was changed.
 
 
- 
replacePermission
public void replacePermission(String oldPerm, String newPerm)
Description copied from interface:ACPReplaces a permission with another in this ACP.- Specified by:
 replacePermissionin interfaceACP- Parameters:
 oldPerm- the old permissionnewPerm- the new permission
 
- 
useLegacyBehavior
protected boolean useLegacyBehavior()
 
 - 
 
 -