Interface JackrabbitAccessControlList

    • Method Detail

      • isMultiValueRestriction

        boolean isMultiValueRestriction​(@NotNull
                                        @NotNull String restrictionName)
                                 throws RepositoryException
        Returns true if the restriction is multivalued; false otherwise. If an given implementation doesn't support multivalued restrictions, this method always returns false.
        Parameters:
        restrictionName - Any of the restriction names retrieved from getRestrictionNames().
        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 returns false.
        Throws:
        RepositoryException - If an error occurs.
        See Also:
        addEntry(Principal, Privilege[], boolean, Map, Map)
      • isEmpty

        boolean isEmpty()
        Returns true 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 policy is 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,
                         @Nullable
                         @Nullable Map<String,​Value> restrictions)
                  throws AccessControlException,
                         RepositoryException
        Adds an access control entry to this policy consisting of the specified principal, the specified privileges, the isAllow 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 for
        privileges - the privileges to add
        isAllow - if true if this is a positive (allow) entry
        restrictions - A map of additional restrictions used to narrow the effect of the entry to be created. The map must map JCR names to a single Value 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 specified principal, the specified privileges, the isAllow 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 for
        privileges - the privileges to add
        isAllow - if true if this is a positive (allow) entry
        restrictions - A map of additional restrictions used to narrow the effect of the entry to be created. The map must map JCR names to a single Value 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 a Value 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[])