Class Right

    • Field Detail

      • LOGIN

        public static final Right LOGIN
        The login access right.
      • VIEW

        public static final Right VIEW
        The view access right.
      • EDIT

        public static final Right EDIT
        The edit access right.
      • DELETE

        public static final Right DELETE
        The delete access right.
      • CREATOR

        public static final Right CREATOR
        Imply rights provided to creator of a document.
      • ADMIN

        public static final Right ADMIN
        The Admin access right.
      • PROGRAM

        public static final Right PROGRAM
        The program access right.
      • SCRIPT

        public static final Right SCRIPT
        The script access right.
      • REGISTER

        public static final Right REGISTER
        The register access right.
      • COMMENT

        public static final Right COMMENT
        The comment access right.
      • CREATE_WIKI

        public static final Right CREATE_WIKI
        The creation of a Wiki right.
      • ILLEGAL

        public static final Right ILLEGAL
        Illegal value.
      • FARM_ONLY

        public static final Set<EntityType> FARM_ONLY
        Targeted entity type list to target only the main wiki.
      • WIKI_ONLY

        public static final Set<EntityType> WIKI_ONLY
        Targeted entity type list to target only wikis (including main wiki).
      • WIKI_SPACE

        public static final Set<EntityType> WIKI_SPACE
        Targeted entity type list to target wikis and spaces.
      • WIKI_SPACE_DOCUMENT

        public static final Set<EntityType> WIKI_SPACE_DOCUMENT
        Targeted entity type list to target wikis, spaces and documents.
    • Method Detail

      • values

        public static List<Right> values()
        Returns:
        an unmodifiable list of available Right
      • toRight

        public static Right toRight​(String string)
        Convert a string to a right.
        Parameters:
        string - String representation of right.
        Returns:
        The corresponding Right instance, or ILLEGAL.
      • getEnabledRights

        public static Set<Right> getEnabledRights​(EntityType entityType)
        Returns the list of rights available for a given entity type.
        Parameters:
        entityType - the entity type, or null for main wiki.
        Returns:
        a list of Right enabled of this entity type
      • get

        public static Right get​(int ordinal)
        Retrieve a right based on its ordinal.
        Parameters:
        ordinal - the ordinal of the right
        Returns:
        the Right
      • size

        public static int size()
        Returns:
        the count of all existing rights
      • getAllRightsAsString

        public static List<String> getAllRightsAsString()
        Returns:
        a list of the string representation of all valid rights.
      • getStandardRights

        @Unstable
        public static List<Right> getStandardRights()
        Returns:
        the list of statically registered rights.
        Since:
        13.5RC1
      • ordinal

        public int ordinal()
        Returns:
        The numeric value of this access right.
      • getImpliedRights

        public Set<Right> getImpliedRights()
        Specified by:
        getImpliedRights in interface RightDescription
        Returns:
        a set of additional rights implied by this right. Note that this method should return null instead of an empty set.
      • getTargetedEntityType

        public Set<EntityType> getTargetedEntityType()
        Specified by:
        getTargetedEntityType in interface RightDescription
        Returns:
        a set of entity type for which this right should be enabled. Special type Right.FARM (==null) could be used to target the EntityType.WIKI for the main wiki only (i.e. PROGRAM)
      • getInheritanceOverridePolicy

        public boolean getInheritanceOverridePolicy()
        Specified by:
        getInheritanceOverridePolicy in interface RightDescription
        Returns:
        Policy on how this right should be overridden by lower levels in the entity reference hierarchy. When true, this right on a document override this right on a wiki.
      • isReadOnly

        public boolean isReadOnly()
        Description copied from interface: RightDescription
        Used to check if this right should be allowed when the wiki is in read-only mode. From the native right, only EDIT, DELETE, COMMENT and REGISTER returns false.
        Specified by:
        isReadOnly in interface RightDescription
        Returns:
        true if this right allow a read-only access to the wiki.