Class PrivilegeBitsProvider

  • All Implemented Interfaces:
    PrivilegeConstants

    public final class PrivilegeBitsProvider
    extends java.lang.Object
    implements PrivilegeConstants
    Reads and writes privilege definitions from and to the repository content without applying any validation.
    • Constructor Detail

      • PrivilegeBitsProvider

        public PrivilegeBitsProvider​(Root root)
    • Method Detail

      • getPrivilegesTree

        @NotNull
        public @NotNull Tree getPrivilegesTree()
        Returns the root tree for all privilege definitions stored in the content repository.
        Returns:
        The privileges root.
      • getBits

        @NotNull
        public @NotNull PrivilegeBits getBits​(@NotNull
                                              @NotNull java.lang.String... privilegeNames)
        Returns the bits for the given privilege names
        Parameters:
        privilegeNames - the names
        Returns:
        the privilege bits
      • getBits

        @NotNull
        public @NotNull PrivilegeBits getBits​(@NotNull
                                              @NotNull java.lang.Iterable<java.lang.String> privilegeNames)
        Returns the bits for the given privilege names
        Parameters:
        privilegeNames - the names
        Returns:
        the privilege bits
      • getBits

        @NotNull
        public @NotNull PrivilegeBits getBits​(@NotNull
                                              @NotNull Privilege[] privileges,
                                              @NotNull
                                              @NotNull NameMapper nameMapper)
        Returns the bits for the given privileges
        Parameters:
        privileges - the privileges
        nameMapper - the name mapper
        Returns:
        the privilege bits
      • getPrivilegeNames

        @NotNull
        public @NotNull java.util.Set<java.lang.String> getPrivilegeNames​(PrivilegeBits privilegeBits)
        Resolve the given privilege bits to a set of privilege names.
        Parameters:
        privilegeBits - An instance of privilege bits.
        Returns:
        The names of the registered privileges associated with the given bits. Any bits that don't have a corresponding privilege definition will be ignored.
      • getAggregatedPrivilegeNames

        @NotNull
        public @NotNull java.lang.Iterable<java.lang.String> getAggregatedPrivilegeNames​(@NotNull
                                                                                         @NotNull java.lang.String... privilegeNames)
        Return the names of the non-aggregate privileges corresponding to the specified privilegeNames.
        Parameters:
        privilegeNames - The privilege names to be converted.
        Returns:
        The names of the non-aggregate privileges that correspond to the given privilegeNames.