Class ArgumentPermissions
java.lang.Object
me.lucko.luckperms.common.command.access.ArgumentPermissions
Implements argument based permission checks for use in command implementations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckArguments(LuckPermsPlugin plugin, Sender sender, CommandPermission base, String... args) Checks if the sender has permission to use the given argumentsstatic booleancheckContext(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 contextsstatic booleancheckGroup(LuckPermsPlugin plugin, Sender sender, String targetGroupName, net.luckperms.api.context.ContextSet contextSet) Checks if the sender has permission to act using a given groupstatic booleancheckGroup(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.static booleancheckModifyPerms(LuckPermsPlugin plugin, Sender sender, CommandPermission base, Object target) Checks if the sender has permission to modify the given targetstatic booleancheckViewPerms(LuckPermsPlugin plugin, Sender sender, CommandPermission base, Object target) Checks if the sender has permission to view the given target
-
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 instancesender- the sender to checkbase- the base permission for the commandargs- 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 instancesender- the sender to checkbase- the base permission for the commandtarget- 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 instancesender- the sender to checkbase- the base permission for the commandtarget- 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 instancesender- the sender to checkbase- the base permission for the commandcontextSet- 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 instancesender- the sender to checkholder- 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 instancesender- the sender to checktargetGroupName- the target groupcontextSet- the contexts the sender is trying to act within- Returns:
- true if the sender should NOT be allowed to act, true if they should
-