Class PermissionGroup

java.lang.Object
eu.cloudnetservice.driver.permission.AbstractPermissible
eu.cloudnetservice.driver.permission.PermissionGroup
All Implemented Interfaces:
eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,Permissible>, eu.cloudnetservice.common.document.property.DocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,Permissible>, eu.cloudnetservice.common.Nameable, Permissible, Comparable<Permissible>

public class PermissionGroup extends AbstractPermissible
A permission group is an implementation of the permissible that extends the permissible in the sense that it adds cosmetic options that can be used by other systems. The permission group allows permission inheritance by specifying the parents using groupNames().
Since:
4.0
See Also:
  • Field Details

    • COL_GROUPS

      public static final Type COL_GROUPS
    • color

      private final String color
    • prefix

      private final String prefix
    • suffix

      private final String suffix
    • display

      private final String display
    • sortId

      private final int sortId
    • defaultGroup

      private final boolean defaultGroup
    • groups

      private final Set<String> groups
  • Constructor Details

  • Method Details

    • builder

      @NonNull public static @NonNull PermissionGroup.Builder builder()
      Creates a new permission group builder instance with all default values.
      Returns:
      the new builder instance.
    • builder

      Creates a new permission group builder instance and copies all values from the given permission group.
      Parameters:
      group - the group to copy from.
      Returns:
      the new builder instance.
      Throws:
      NullPointerException - if the given group is null.
    • prefix

      @NonNull public @NonNull String prefix()
      Gets the prefix of the group.
      Returns:
      the prefix of the group.
    • color

      @NonNull public @NonNull String color()
      Gets the color of the group.
      Returns:
      the color of the group.
    • suffix

      @NonNull public @NonNull String suffix()
      Gets the suffix of the group.
      Returns:
      the suffix of the group.
    • display

      @NonNull public @NonNull String display()
      Gets the display of the group.
      Returns:
      the display of the group.
    • sortId

      public int sortId()
      Gets the prefix of the group.
      Returns:
      the prefix of the group.
    • defaultGroup

      public boolean defaultGroup()
      Gets whether this group is the default group or not.

      Note: There might be multiple default groups, but always the first one is chosen as default group without being deterministic.

      Returns:
      whether this group is the default group or not.
    • groupNames

      @NonNull public @NonNull Collection<String> groupNames()
      Gets all parent groups of this group. This group inherits all permissions of the parent groups.
      Returns:
      all parent groups.