Interface JackrabbitAccessControlList
-
- All Superinterfaces:
AccessControlList
,AccessControlPolicy
,JackrabbitAccessControlPolicy
- All Known Subinterfaces:
PrincipalAccessControlList
- All Known Implementing Classes:
AbstractAccessControlList
,ImmutableACL
@ProviderType public interface JackrabbitAccessControlList extends JackrabbitAccessControlPolicy, AccessControlList
JackrabbitAccessControlList
is an extension of theAccessControlList
. Similar to the latter any modifications made will not take effect, until it iswritten back
andsaved
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow)
Same asaddEntry(Principal, Privilege[], boolean, Map)
using some implementation specific restrictions.boolean
addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow, @Nullable Map<String,Value> restrictions)
Adds an access control entry to this policy consisting of the specifiedprincipal
, the specifiedprivileges
, theisAllow
flag and an optional map containing additional restrictions.boolean
addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow, @Nullable Map<String,Value> restrictions, @Nullable Map<String,Value[]> mvRestrictions)
Adds an access control entry to this policy consisting of the specifiedprincipal
, the specifiedprivileges
, theisAllow
flag and an optional map containing additional restrictions.@NotNull String[]
getRestrictionNames()
Returns the names of the supported restrictions or an empty array if no restrictions are respected.int
getRestrictionType(@NotNull String restrictionName)
Return the expectedproperty type
of the restriction with the specifiedrestrictionName
.boolean
isEmpty()
Returnstrue
if this policy does not yet define any entries.boolean
isMultiValueRestriction(@NotNull String restrictionName)
Returnstrue
if the restriction is multivalued;false
otherwise.void
orderBefore(@NotNull AccessControlEntry srcEntry, @Nullable AccessControlEntry destEntry)
If theAccessControlList
implementation supports reordering of entries the specifiedsrcEntry
is inserted at the position of the specifieddestEntry
.int
size()
Returns the number of entries or 0 if the policyis empty
.-
Methods inherited from interface javax.jcr.security.AccessControlList
addAccessControlEntry, getAccessControlEntries, removeAccessControlEntry
-
Methods inherited from interface org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy
getPath
-
-
-
-
Method Detail
-
getRestrictionNames
@NotNull @NotNull String[] getRestrictionNames() throws RepositoryException
Returns the names of the supported restrictions or an empty array if no restrictions are respected.- Returns:
- the names of the supported restrictions or an empty array.
- Throws:
RepositoryException
- If an error occurs.- See Also:
addEntry(Principal, Privilege[], boolean, Map)
-
getRestrictionType
int getRestrictionType(@NotNull @NotNull String restrictionName) throws RepositoryException
Return the expectedproperty type
of the restriction with the specifiedrestrictionName
.- Parameters:
restrictionName
- Any of the restriction names retrieved fromgetRestrictionNames()
.- Returns:
- expected
property type
. - Throws:
RepositoryException
- If an error occurs.
-
isMultiValueRestriction
boolean isMultiValueRestriction(@NotNull @NotNull String restrictionName) throws RepositoryException
Returnstrue
if the restriction is multivalued;false
otherwise. If an given implementation doesn't support multivalued restrictions, this method always returnsfalse
.- Parameters:
restrictionName
- Any of the restriction names retrieved fromgetRestrictionNames()
.- Returns:
true
if the restriction is multivalued;false
if the restriction with the given name is single value or if the implementation doesn't support multivalued restrictions, this method always returnsfalse
.- Throws:
RepositoryException
- If an error occurs.- See Also:
addEntry(Principal, Privilege[], boolean, Map, Map)
-
isEmpty
boolean isEmpty()
Returnstrue
if this policy does not yet define any entries.- Returns:
- If no entries are present.
-
size
int size()
Returns the number of entries or 0 if the policyis empty
.- Returns:
- The number of entries present or 0 if the policy
is empty
.
-
addEntry
boolean addEntry(@NotNull @NotNull Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow) throws AccessControlException, RepositoryException
Same asaddEntry(Principal, Privilege[], boolean, Map)
using some implementation specific restrictions.- Parameters:
principal
- the principal to add the entry forprivileges
- the privileges to addisAllow
- iftrue
if this is a positive (allow) entry- Returns:
- true if this policy has changed by incorporating the given entry; false otherwise.
- Throws:
AccessControlException
- If any of the given parameter is invalid or cannot be handled by the implementation.RepositoryException
- If another error occurs.- See Also:
AccessControlList.addAccessControlEntry(Principal, Privilege[])
-
addEntry
boolean addEntry(@NotNull @NotNull Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow, @Nullable @Nullable Map<String,Value> restrictions) throws AccessControlException, RepositoryException
Adds an access control entry to this policy consisting of the specifiedprincipal
, the specifiedprivileges
, theisAllow
flag and an optional map containing additional restrictions.This method returns
true
if this policy was modified,false
otherwise.An
AccessControlException
is thrown if any of the specified parameters is invalid or if some other access control related exception occurs.- Parameters:
principal
- the principal to add the entry forprivileges
- the privileges to addisAllow
- iftrue
if this is a positive (allow) entryrestrictions
- A map of additional restrictions used to narrow the effect of the entry to be created. The map must map JCR names to a singleValue
object.- Returns:
- true if this policy has changed by incorporating the given entry; false otherwise.
- Throws:
AccessControlException
- If any of the given parameter is invalid or cannot be handled by the implementation.RepositoryException
- If another error occurs.- See Also:
AccessControlList.addAccessControlEntry(Principal, Privilege[])
-
addEntry
boolean addEntry(@NotNull @NotNull Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow, @Nullable @Nullable Map<String,Value> restrictions, @Nullable @Nullable Map<String,Value[]> mvRestrictions) throws AccessControlException, RepositoryException
Adds an access control entry to this policy consisting of the specifiedprincipal
, the specifiedprivileges
, theisAllow
flag and an optional map containing additional restrictions.This method returns
true
if this policy was modified,false
otherwise.An
AccessControlException
is thrown if any of the specified parameters is invalid or if some other access control related exception occurs.- Parameters:
principal
- the principal to add the entry forprivileges
- the privileges to addisAllow
- iftrue
if this is a positive (allow) entryrestrictions
- A map of additional restrictions used to narrow the effect of the entry to be created. The map must map JCR names to a singleValue
object.mvRestrictions
- A map of additional multivalued restrictions used to narrow the effect of the entry to be created. The map must map JCR names to aValue
array.- Returns:
- true if this policy has changed by incorporating the given entry; false otherwise.
- Throws:
AccessControlException
- If any of the given parameter is invalid or cannot be handled by the implementation.RepositoryException
- If another error occurs.- Since:
- 2.8
- See Also:
AccessControlList.addAccessControlEntry(Principal, Privilege[])
-
orderBefore
void orderBefore(@NotNull @NotNull AccessControlEntry srcEntry, @Nullable @Nullable AccessControlEntry destEntry) throws AccessControlException, UnsupportedRepositoryOperationException, RepositoryException
If theAccessControlList
implementation supports reordering of entries the specifiedsrcEntry
is inserted at the position of the specifieddestEntry
.If
destEntry
isnull
the entry is moved to the end of the list.If
srcEntry
anddestEntry
are the same no changes are made.- Parameters:
srcEntry
- The access control entry to be moved within the list.destEntry
- The entry before which thesrcEntry
will be moved.- Throws:
AccessControlException
- If any of the given entries is invalid or cannot be handled by the implementation.UnsupportedRepositoryOperationException
- If ordering is not supported.RepositoryException
- If another error occurs.
-
-