Interface JackrabbitAccessControlList
-
- All Superinterfaces:
AccessControlList,AccessControlPolicy,JackrabbitAccessControlPolicy
- All Known Subinterfaces:
PrincipalAccessControlList
- All Known Implementing Classes:
AbstractAccessControlList,ImmutableACL
@ProviderType public interface JackrabbitAccessControlList extends JackrabbitAccessControlPolicy, AccessControlList
JackrabbitAccessControlListis an extension of theAccessControlList. Similar to the latter any modifications made will not take effect, until it iswritten backandsaved.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddEntry(@NotNull java.security.Principal principal, @NotNull Privilege[] privileges, boolean isAllow)Same asaddEntry(Principal, Privilege[], boolean, Map)using some implementation specific restrictions.booleanaddEntry(@NotNull java.security.Principal principal, @NotNull Privilege[] privileges, boolean isAllow, @Nullable java.util.Map<java.lang.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 java.security.Principal principal, @NotNull Privilege[] privileges, boolean isAllow, @Nullable java.util.Map<java.lang.String,Value> restrictions, @Nullable java.util.Map<java.lang.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 java.lang.String[]getRestrictionNames()Returns the names of the supported restrictions or an empty array if no restrictions are respected.intgetRestrictionType(@NotNull java.lang.String restrictionName)Return the expectedproperty typeof the restriction with the specifiedrestrictionName.booleanisEmpty()Returnstrueif this policy does not yet define any entries.booleanisMultiValueRestriction(@NotNull java.lang.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, removeAccessControlEntry
-
Methods inherited from interface org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy
getPath
-
-
-
-
Method Detail
-
getRestrictionNames
@NotNull @NotNull java.lang.String[] getRestrictionNames() throws RepositoryExceptionReturns 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 java.lang.String restrictionName) throws RepositoryExceptionReturn 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 java.lang.String restrictionName) throws RepositoryExceptionReturnstrueif 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:
addEntry(Principal, Privilege[], boolean, Map, Map)
-
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 java.security.Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow) throws AccessControlException, RepositoryExceptionSame 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:
AccessControlList.addAccessControlEntry(Principal, Privilege[])
-
addEntry
boolean addEntry(@NotNull @NotNull java.security.Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow, @Nullable @Nullable java.util.Map<java.lang.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:
AccessControlList.addAccessControlEntry(Principal, Privilege[])
-
addEntry
boolean addEntry(@NotNull @NotNull java.security.Principal principal, @NotNull @NotNull Privilege[] privileges, boolean isAllow, @Nullable @Nullable java.util.Map<java.lang.String,Value> restrictions, @Nullable @Nullable java.util.Map<java.lang.String,Value[]> mvRestrictions) 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.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:
AccessControlList.addAccessControlEntry(Principal, Privilege[])
-
orderBefore
void orderBefore(@NotNull @NotNull AccessControlEntry srcEntry, @Nullable @Nullable AccessControlEntry destEntry) throws AccessControlException, UnsupportedRepositoryOperationException, RepositoryExceptionIf 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.
-
-