Interface PermissionUser

All Superinterfaces:
PermissionEntity

public interface PermissionUser extends PermissionEntity
Classic online-subject facade for a PermissionsEx user.

Extends PermissionEntity and adds group membership, rank-ladder promotion/demotion, and timed group assignment. Concrete implementations live in permissionsex-core (DefaultPermissionUser).

Inherited PermissionEntity capabilities include (non-exhaustive): identity and lifecycle (PermissionEntity.getIdentifier(), PermissionEntity.getName(), PermissionEntity.initialize(), PermissionEntity.save(), PermissionEntity.remove()), permission checks and mutation (PermissionEntity.has(String), PermissionEntity.addPermission(String), PermissionEntity.setPermissions(List, String)), prefix/suffix/options (PermissionEntity.getPrefix(String), PermissionEntity.getOption(String, String)), timed permissions (PermissionEntity.addTimedPermission(String, String, int)), and parent/group resolution (PermissionEntity.getParents(String), PermissionEntity.getOwnParents(String), PermissionEntity.setParents(List, String)).

World-scoped overloads use null for the global (common) context when no world is specified.

  • Method Details

    • getAllGroups

      Deprecated.
      Returns all parent groups for this user, keyed by world name.
      Returns:
      map of world name to ordered list of parent groups (including inherited parents)
    • addGroup

      void addGroup(String groupName, String worldName)
      Adds this user to a group in the given world context.

      The assignment is direct (own parent); it does not modify group inheritance trees.

      Parameters:
      groupName - name of the group to join
      worldName - world context, or null for the global context
    • addGroup

      void addGroup(String groupName)
      Adds this user to a group in the global context.
      Parameters:
      groupName - name of the group to join
      See Also:
    • addGroup

      void addGroup(PermissionGroup group, String worldName)
      Adds this user to a group in the given world context.
      Parameters:
      group - group to join; no-op if null
      worldName - world context, or null for the global context
      See Also:
    • addGroup

      void addGroup(PermissionGroup group)
      Adds this user to a group in the global context.
      Parameters:
      group - group to join; no-op if null
      See Also:
    • addGroup

      void addGroup(String groupName, String worldName, long lifetime)
      Adds this user to a group for a limited time in the given world context.

      When lifetime is greater than zero, membership expires after that many seconds. Expiration is tracked via a group-<name>-until option and enforced by updateTimedGroups(). A lifetime of zero behaves like a permanent addGroup(String, String) call.

      Parameters:
      groupName - name of the group to join
      worldName - world context, or null for the global context
      lifetime - membership duration in seconds; 0 for no expiration
    • removeGroup

      void removeGroup(String groupName, String worldName)
      Removes this user's direct membership in a group for the given world context.
      Parameters:
      groupName - name of the group to leave
      worldName - world context, or null for the global context
    • removeGroup

      void removeGroup(String groupName)
      Removes this user's direct membership in a group across all world contexts and the global context.
      Parameters:
      groupName - name of the group to leave
      See Also:
    • removeGroup

      void removeGroup(PermissionGroup group, String worldName)
      Removes this user's direct membership in a group for the given world context.
      Parameters:
      group - group to leave; no-op if null
      worldName - world context, or null for the global context
      See Also:
    • removeGroup

      void removeGroup(PermissionGroup group)
      Removes this user's direct membership in a group across all world contexts and the global context.
      Parameters:
      group - group to leave; no-op if null
      See Also:
    • inGroup

      boolean inGroup(PermissionGroup group, String worldName, boolean checkInheritance)
      Checks whether this user belongs to the given group in a world context, optionally considering inherited (indirect) membership.

      When checkInheritance is true, membership is satisfied if the user is directly assigned to group or to any group that is a descendant of group in the inheritance tree. When false, only a direct parent assignment to group counts.

      Parameters:
      group - group to test
      worldName - world context, or null for the global context
      checkInheritance - true to match descendant groups; false for direct membership only
      Returns:
      true if the user is in the group under the given rules
    • inGroup

      boolean inGroup(PermissionGroup group, boolean checkInheritance)
      Checks whether this user belongs to the given group in any known world or the global context.
      Parameters:
      group - group to test
      checkInheritance - true to match descendant groups; false for direct membership only
      Returns:
      true if the user is in the group in at least one context
      See Also:
    • inGroup

      boolean inGroup(String groupName, String worldName, boolean checkInheritance)
      Checks whether this user belongs to the named group in a world context.
      Parameters:
      groupName - name of the group to test
      worldName - world context, or null for the global context
      checkInheritance - true to match descendant groups; false for direct membership only
      Returns:
      true if the user is in the group under the given rules
      See Also:
    • inGroup

      boolean inGroup(String groupName, boolean checkInheritance)
      Checks whether this user belongs to the named group in any known world or the global context.
      Parameters:
      groupName - name of the group to test
      checkInheritance - true to match descendant groups; false for direct membership only
      Returns:
      true if the user is in the group in at least one context
      See Also:
    • inGroup

      boolean inGroup(PermissionGroup group, String worldName)
      Checks whether this user belongs to the given group in a world context, including inherited membership.
      Parameters:
      group - group to test
      worldName - world context, or null for the global context
      Returns:
      true if the user is directly or indirectly in the group
      See Also:
    • inGroup

      boolean inGroup(PermissionGroup group)
      Checks whether this user belongs to the given group in any context, including inherited membership.
      Parameters:
      group - group to test
      Returns:
      true if the user is directly or indirectly in the group
      See Also:
    • inGroup

      boolean inGroup(String groupName, String worldName)
      Checks whether this user belongs to the named group in a world context, including inherited membership.
      Parameters:
      groupName - name of the group to test
      worldName - world context, or null for the global context
      Returns:
      true if the user is directly or indirectly in the group
      See Also:
    • inGroup

      boolean inGroup(String groupName)
      Checks whether this user belongs to the named group in any context, including inherited membership.
      Parameters:
      groupName - name of the group to test
      Returns:
      true if the user is directly or indirectly in the group
      See Also:
    • promote

      @Deprecated(since="1.23.5") PermissionGroup promote(PermissionUser promoter, String ladderName) throws RankingException
      Deprecated.
      Prefer PermissionsEx.getApi().getLadderManager().promote(user, ladderName) (modern dev.rono.permissions.api.ladder.LadderManager). This method remains for binary compatibility with hook plugins compiled against older releases.
      Promotes this user one step up on the specified rank ladder.

      Replaces the user's current ladder group with the next higher-ranked group on the same ladder. Only direct group assignments are changed; inherited parents are not modified.

      If promoter is non-null and ranked on the ladder, their rank must be strictly higher (numerically lower) than this user's rank. Pass null when the action is performed from the console or by a plugin without rank restrictions.

      Parameters:
      promoter - user authorizing the promotion, or null for unrestricted promotion
      ladderName - rank ladder name; implementations typically default empty values to "default"
      Returns:
      the group this user was promoted into
      Throws:
      RankingException - if this user is not on the ladder, the promoter lacks sufficient rank, or no higher group exists on the ladder
    • demote

      @Deprecated(since="1.23.5") PermissionGroup demote(PermissionUser demoter, String ladderName) throws RankingException
      Deprecated.
      Prefer PermissionsEx.getApi().getLadderManager().demote(user, ladderName) (modern dev.rono.permissions.api.ladder.LadderManager). This method remains for binary compatibility with hook plugins compiled against older releases.
      Demotes this user one step down on the specified rank ladder.

      Replaces the user's current ladder group with the next lower-ranked group on the same ladder. Only direct group assignments are changed; inherited parents are not modified.

      If demoter is non-null and ranked on the ladder, their rank must be strictly higher (numerically lower) than this user's rank. Pass null when the action is performed from the console or by a plugin without rank restrictions.

      Parameters:
      demoter - user authorizing the demotion, or null for unrestricted demotion
      ladderName - rank ladder name; implementations typically default empty values to "default"
      Returns:
      the group this user was demoted into
      Throws:
      RankingException - if this user is not on the ladder, the demoter lacks sufficient rank, or no lower group exists on the ladder
    • isRanked

      boolean isRanked(String ladder)
      Returns whether this user holds a ranked group on the given ladder.
      Parameters:
      ladder - rank ladder name
      Returns:
      true if getRank(String) would return a value greater than zero
    • getRank

      int getRank(String ladder)
      Returns this user's numeric rank on the given ladder.

      Lower numbers denote higher standing on the ladder. Returns 0 when the user is not ranked on that ladder.

      Parameters:
      ladder - rank ladder name
      Returns:
      rank value, or 0 if not ranked
    • getRankLadderGroup

      PermissionGroup getRankLadderGroup(String ladder)
      Returns the group that places this user on the given rank ladder.
      Parameters:
      ladder - rank ladder name; implementations typically default empty values to "default"
      Returns:
      the ranked group, or null if the user is not on the ladder
    • getRankLadders

      Map<String,PermissionGroup> getRankLadders()
      Returns every rank ladder this user participates in and the corresponding group for each.
      Returns:
      map of ladder name to the user's group on that ladder; never null
    • updateTimedGroups

      void updateTimedGroups()
      Removes expired timed group memberships and schedules the next expiration check.

      Scans group-&lt;name&gt;-until options set by addGroup(String, String, long). Called automatically during PermissionEntity.initialize() and after timed group assignment; plugins normally do not need to invoke this directly.

    • getGroupsNames

      @Deprecated String[] getGroupsNames()
      Deprecated.
      Returns parent group names for this user in the global context.
      Returns:
      array of group names (including inherited parents)
    • getGroupsNames

      @Deprecated String[] getGroupsNames(String world)
      Returns parent group names for this user in the given world context.
      Parameters:
      world - world context, or null for the global context
      Returns:
      array of group names (including inherited parents)
    • getGroups

      Deprecated.
      Returns parent groups for this user in the global context.
      Returns:
      array of parent groups (including inherited parents)
    • getGroups

      @Deprecated PermissionGroup[] getGroups(String worldName)
      Deprecated.
      Returns parent groups for this user in the given world context.
      Parameters:
      worldName - world context, or null for the global context
      Returns:
      array of parent groups (including inherited parents)
    • getGroupNames

      @Deprecated String[] getGroupNames()
      Returns own (direct) parent group names in the global context.
      Returns:
      array of directly assigned group names
    • getGroupNames

      @Deprecated String[] getGroupNames(String worldName)
      Returns own (direct) parent group names in the given world context.
      Parameters:
      worldName - world context, or null for the global context
      Returns:
      array of directly assigned group names
    • setGroups

      @Deprecated void setGroups(String[] groups, String worldName)
      Replaces this user's direct parent groups in the given world context.
      Parameters:
      groups - new parent group names
      worldName - world context, or null for the global context
    • setGroups

      @Deprecated void setGroups(String[] groups)
      Replaces this user's direct parent groups in the global context.
      Parameters:
      groups - new parent group names
    • setGroups

      @Deprecated void setGroups(PermissionGroup[] parentGroups, String worldName)
      Replaces this user's direct parent groups in the given world context.
      Parameters:
      parentGroups - new parent group objects
      worldName - world context, or null for the global context
    • setGroups

      @Deprecated void setGroups(PermissionGroup[] parentGroups)
      Deprecated.
      Replaces this user's direct parent groups in the global context.
      Parameters:
      parentGroups - new parent group objects