public class ACPImpl extends Object implements ACP
Constructor and Description |
---|
ACPImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addAccessRule(String aclName,
ACE ace) |
boolean |
addACE(String aclName,
ACE ace)
Add an ACE to the given
aclName . |
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.
|
void |
addACL(int pos,
ACL acl) |
void |
addACL(String afterMe,
ACL acl) |
boolean |
blockInheritance(String aclName,
String username)
Block the inheritance on the given
aclName . |
ACPImpl |
clone()
Return a recursive copy of the ACP sharing no mutable substructure with the original
|
static Access |
getAccess(ACE ace,
String[] principals,
String[] permissions) |
Access |
getAccess(String[] principals,
String[] permissions)
Checks the access on the ACLs for each set of the given permissions and principals.
|
Access |
getAccess(String principal,
String permission)
Check whether this ACP grant the given permission on the given user, denies it or doesn't specify a rule.
|
ACL |
getACL(String name) |
ACL[] |
getACLs() |
ACL |
getMergedACLs(String name) |
ACL |
getOrCreateACL() |
ACL |
getOrCreateACL(String name) |
String[] |
listUsernamesForAnyPermission(Set<String> perms)
Returns the usernames granted to perform an operation based on a list of permissions.
|
static ACL |
newACL(String name) |
boolean |
removeACE(String aclName,
ACE ace)
Remove an ACE on the given
aclName . |
boolean |
removeACEsByUsername(String username)
Remove all ACEs for
username on the whole ACP. |
boolean |
removeACEsByUsername(String aclName,
String username)
Remove all ACEs for
username on the given aclName . |
ACL |
removeACL(String name) |
boolean |
replaceACE(String aclName,
ACE oldACE,
ACE newACE)
Replace the
oldACE with newACE on the given aclName , only if the oldACE exists. |
void |
setRules(String aclName,
UserEntry[] userEntries)
Replaces the modifiable user entries (associated with the currentDocument) related to the ACP.
|
void |
setRules(String aclName,
UserEntry[] userEntries,
boolean overwrite)
Replaces the modifiable user entries (associated with the currentDocument) related to the ACP.
|
void |
setRules(UserEntry[] userEntries)
Replaces the modifiable user entries (associated with the currentDocument) related to the current ACP.
|
void |
setRules(UserEntry[] userEntries,
boolean overwrite)
Replaces the modifiable user entries (associated with the currentDocument) related to the current ACP.
|
boolean |
unblockInheritance(String aclName)
Unblock the inheritance on the given
aclName . |
public ACPImpl()
public void addACL(ACL acl)
public ACL getMergedACLs(String name)
getMergedACLs
in interface ACP
public Access getAccess(String principal, String permission)
ACP
This is checking only the ACLs on that ACP. Parents if any are not checked.
public Access getAccess(String[] principals, String[] permissions)
ACP
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.
public void addAccessRule(String aclName, ACE ace)
public ACL getOrCreateACL(String name)
getOrCreateACL
in interface ACP
public ACL getOrCreateACL()
getOrCreateACL
in interface ACP
public void setRules(String aclName, UserEntry[] userEntries)
ACP
Considers that all the passed entries are modifiable and attempts to set them as entries related to the current document.
public void setRules(String aclName, UserEntry[] userEntries, boolean overwrite)
ACP
Considers that all the passed entries are modifiable and attempts to set them as entries related to the current document.
public void setRules(UserEntry[] userEntries)
ACP
Considers that all the passed entries are modifiable and attempts to set them as local entries related to the current document.
public void setRules(UserEntry[] userEntries, boolean overwrite)
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.
public String[] listUsernamesForAnyPermission(Set<String> perms)
ACP
listUsernamesForAnyPermission
in interface ACP
perms
- the list of permissions.public ACPImpl clone()
ACP
public boolean blockInheritance(String aclName, String username)
ACP
aclName
.blockInheritance
in interface ACP
username
- the user blocking the inheritancepublic boolean unblockInheritance(String aclName)
ACP
aclName
.unblockInheritance
in interface ACP
public boolean addACE(String aclName, ACE ace)
ACP
aclName
.public boolean replaceACE(String aclName, ACE oldACE, ACE newACE)
ACP
oldACE
with newACE
on the given aclName
, only if the oldACE
exists.
The newACE
keeps the same index as oldACE
.
replaceACE
in interface ACP
public boolean removeACE(String aclName, ACE ace)
ACP
aclName
.public boolean removeACEsByUsername(String aclName, String username)
ACP
username
on the given aclName
.removeACEsByUsername
in interface ACP
public boolean removeACEsByUsername(String username)
ACP
username
on the whole ACP.removeACEsByUsername
in interface ACP
Copyright © 2018 Nuxeo. All rights reserved.