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 the AccessControlList.
Similar to the latter any modifications made will not take effect, until it is
written back and saved.-
Method Summary
Modifier and TypeMethodDescriptionbooleanSame asaddEntry(Principal, Privilege[], boolean, Map)using some implementation specific restrictions.booleanaddEntry(@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, theisAllowflag and an optional map containing additional restrictions.booleanaddEntry(@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, theisAllowflag and an optional map containing additional restrictions.@NotNull String[]Returns the names of the supported restrictions or an empty array if no restrictions are respected.intgetRestrictionType(@NotNull String restrictionName) Return the expectedproperty typeof the restriction with the specifiedrestrictionName.booleanisEmpty()Returnstrueif this policy does not yet define any entries.booleanisMultiValueRestriction(@NotNull String restrictionName) Returnstrueif the restriction is multivalued;falseotherwise.voidorderBefore(@NotNull AccessControlEntry srcEntry, @Nullable AccessControlEntry destEntry) If theAccessControlListimplementation supports reordering of entries the specifiedsrcEntryis inserted at the position of the specifieddestEntry.intsize()Returns the number of entries or 0 if the policyis empty.Methods inherited from interface javax.jcr.security.AccessControlList
addAccessControlEntry, getAccessControlEntries, removeAccessControlEntryMethods inherited from interface org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy
getPath
-
Method Details
-
getRestrictionNames
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:
-
getRestrictionType
Return the expectedproperty typeof 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 Returnstrueif the restriction is multivalued;falseotherwise. If an given implementation doesn't support multivalued restrictions, this method always returnsfalse.- Parameters:
restrictionName- Any of the restriction names retrieved fromgetRestrictionNames().- Returns:
trueif the restriction is multivalued;falseif 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:
-
isEmpty
boolean isEmpty()Returnstrueif 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- iftrueif 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:
-
addEntry
boolean addEntry(@NotNull @NotNull Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow, @Nullable @Nullable Map<String, Value> restrictions) throws AccessControlException, RepositoryExceptionAdds an access control entry to this policy consisting of the specifiedprincipal, the specifiedprivileges, theisAllowflag and an optional map containing additional restrictions.This method returns
trueif this policy was modified,falseotherwise.An
AccessControlExceptionis 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- iftrueif 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 singleValueobject.- 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:
-
addEntry
boolean addEntry(@NotNull @NotNull Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow, @Nullable @Nullable Map<String, Value> restrictions, @Nullable @Nullable Map<String, throws AccessControlException, RepositoryExceptionValue[]> mvRestrictions) Adds an access control entry to this policy consisting of the specifiedprincipal, the specifiedprivileges, theisAllowflag and an optional map containing additional restrictions.This method returns
trueif this policy was modified,falseotherwise.An
AccessControlExceptionis 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- iftrueif 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 singleValueobject.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 aValuearray.- 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:
-
orderBefore
void orderBefore(@NotNull @NotNull AccessControlEntry srcEntry, @Nullable @Nullable AccessControlEntry destEntry) throws AccessControlException, UnsupportedRepositoryOperationException, RepositoryException If theAccessControlListimplementation supports reordering of entries the specifiedsrcEntryis inserted at the position of the specifieddestEntry.If
destEntryisnullthe entry is moved to the end of the list.If
srcEntryanddestEntryare the same no changes are made.- Parameters:
srcEntry- The access control entry to be moved within the list.destEntry- The entry before which thesrcEntrywill 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.
-