Package org.nuxeo.ecm.core.api.security
Interface ACL
- All Superinterfaces:
Cloneable
,Collection<ACE>
,Iterable<ACE>
,List<ACE>
,Serializable
- All Known Implementing Classes:
ACLImpl
An ACL (Access Control List) is a list of ACEs (Access Control Entry).
An ACP may contain several ACL identified by a name. This is to let external modules add security rules. There are 2 default ACLs:
- the
local
ACL - this is the default type of ACL that may be defined by an user locally to a document (using a security UI).
This is the only ACL an user can change - the
inherited
- this is a special ACL generated by merging all document parents ACL. This ACL is read only (cannot be modified locally on the document since it is inherited.
- Author:
- Bogdan Stefanescu
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Add an ACE.boolean
blockInheritance
(String username) Block the inheritance.clone()
Returns a recursive copy of the ACL sharing no mutable substructure with the original.ACE[]
getACEs()
Returns the ACEs defined by this list as an array.getName()
Gets the ACL name.boolean
removeByUsername
(String username) Remove all ACEs forusername
.boolean
Replace theoldACE
withnewACE
, only if theoldACE
exists.void
replacePermission
(String oldPerm, String newPerm) Replaces a permission with another in this ACL.void
Sets the ACEs defined by this ACL.boolean
Unblock the inheritance.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Field Details
-
LOCAL_ACL
- See Also:
-
INHERITED_ACL
- See Also:
-
-
Method Details
-
getName
String getName()Gets the ACL name.- Returns:
- the ACL name
-
getACEs
ACE[] getACEs()Returns the ACEs defined by this list as an array. -
setACEs
Sets the ACEs defined by this ACL.- Parameters:
aces
- the ACE array
-
blockInheritance
Block the inheritance.- Parameters:
username
- the user blocking the inheritance- Returns:
- true if the ACL was changed.
- Since:
- 7.4
-
unblockInheritance
boolean unblockInheritance()Unblock the inheritance.- Returns:
- true if the ACL was changed.
- Since:
- 7.4
-
add
Add an ACE. -
replace
Replace theoldACE
withnewACE
, only if theoldACE
exists.The
newACE
keeps the same index asoldACE
.- Returns:
- true if the ACL was changed.
- Since:
- 7.4
-
removeByUsername
Remove all ACEs forusername
.- Returns:
- true if the ACL was changed.
- Since:
- 7.4
-
clone
Object clone()Returns a recursive copy of the ACL sharing no mutable substructure with the original.- Returns:
- a copy
-
replacePermission
Replaces a permission with another in this ACL.- Parameters:
oldPerm
- the old permissionnewPerm
- the new permission- Since:
- 11.3
-