Class ArgumentPermissions

java.lang.Object
me.lucko.luckperms.common.command.access.ArgumentPermissions

public final class ArgumentPermissions extends Object
Implements argument based permission checks for use in command implementations.
  • Method Details

    • checkArguments

      public static boolean checkArguments(LuckPermsPlugin plugin, Sender sender, CommandPermission base, String... args)
      Checks if the sender has permission to use the given arguments
      Parameters:
      plugin - the plugin instance
      sender - the sender to check
      base - the base permission for the command
      args - the arguments the sender is trying to use
      Returns:
      true if the sender should NOT be allowed to use the arguments, true if they should
    • checkModifyPerms

      public static boolean checkModifyPerms(LuckPermsPlugin plugin, Sender sender, CommandPermission base, Object target)
      Checks if the sender has permission to modify the given target
      Parameters:
      plugin - the plugin instance
      sender - the sender to check
      base - the base permission for the command
      target - the object the sender is truing to modify
      Returns:
      true if the sender should NOT be allowed to modify the target, true if they should
    • checkViewPerms

      public static boolean checkViewPerms(LuckPermsPlugin plugin, Sender sender, CommandPermission base, Object target)
      Checks if the sender has permission to view the given target
      Parameters:
      plugin - the plugin instance
      sender - the sender to check
      base - the base permission for the command
      target - the object the sender is truing to view
      Returns:
      true if the sender should NOT be allowed to view the target, true if they should
    • checkContext

      public static boolean checkContext(LuckPermsPlugin plugin, Sender sender, CommandPermission base, net.luckperms.api.context.ContextSet contextSet)
      Checks if the sender has permission to act within a given set of contexts
      Parameters:
      plugin - the plugin instance
      sender - the sender to check
      base - the base permission for the command
      contextSet - the contexts the sender is trying to act within
      Returns:
      true if the sender should NOT be allowed to act, true if they should
    • checkGroup

      public static boolean checkGroup(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, net.luckperms.api.context.ContextSet contextSet)
      Checks if the sender has permission to act using a given group, if holder is a group.
      Parameters:
      plugin - the plugin instance
      sender - the sender to check
      holder - the target group (doesn't have to be a group instance - this method checks that)
      contextSet - the contexts the sender is trying to act within
      Returns:
      true if the sender should NOT be allowed to act, true if they should
    • checkGroup

      public static boolean checkGroup(LuckPermsPlugin plugin, Sender sender, String targetGroupName, net.luckperms.api.context.ContextSet contextSet)
      Checks if the sender has permission to act using a given group
      Parameters:
      plugin - the plugin instance
      sender - the sender to check
      targetGroupName - the target group
      contextSet - the contexts the sender is trying to act within
      Returns:
      true if the sender should NOT be allowed to act, true if they should