public interface ACP extends Serializable, Cloneable
An ACP may contains several ACLs (access control list) identified by names.
The list of ACLs is ordered so that when checking permissions the ACL are consulted in an ascending order. (The ACL on position 0 is consulted first).
Every ACP has at least one ACL having the reserved name "local". This is the only user editable list (through the security UI).
Other ACLs are used internally and are editable only through the API.
Also an ACP may have a list named "inherited" that represents the ACLs inherited from the resource parents if any. These ACLs are merged in a single list that is always read only even through the API.
Modifier and Type | Method and Description |
---|---|
void |
addACL(ACL acl) |
void |
addACL(int pos,
ACL acl) |
void |
addACL(String afterMe,
ACL acl) |
ACP |
clone()
Return a recursive copy of the ACP sharing no mutable substructure with the original
|
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)
Deprecated.
Use the method from UserManager service getUsersForPermission instead
|
ACL |
removeACL(String name) |
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.
|
Access getAccess(String principal, String permission)
This is checking only the ACLs on that ACP. Parents if any are not checked.
principal
- the principal to checkpermission
- the permission to checkAccess getAccess(String[] principals, String[] permissions)
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.
principals
- permissions
- void setRules(UserEntry[] userEntries)
Considers that all the passed entries are modifiable and attempts to set them as local entries related to the current document.
userEntries
- void setRules(UserEntry[] userEntries, boolean overwrite)
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.
userEntries
- overwrite
- if true, will overwrite the whole current ACLvoid setRules(String aclName, UserEntry[] userEntries)
Considers that all the passed entries are modifiable and attempts to set them as entries related to the current document.
aclName
- userEntries
- void setRules(String aclName, UserEntry[] userEntries, boolean overwrite)
Considers that all the passed entries are modifiable and attempts to set them as entries related to the current document.
aclName
- userEntries
- overwrite
- if true, will overwrite the whole ACLvoid addACL(ACL acl)
void addACL(int pos, ACL acl)
ACL[] getACLs()
ACL getOrCreateACL()
@Deprecated String[] listUsernamesForAnyPermission(Set<String> perms)
perms
- the list of permissions.ACP clone()
Copyright © 2015 Nuxeo SA. All rights reserved.