Implement argument based permissions for LP commands - closes #52, #170, #174

This commit is contained in:
Luck
2017-07-07 12:43:13 +01:00
Unverified
parent 9e83a5e4d9
commit 42d48c8da2
59 changed files with 929 additions and 44 deletions
@@ -25,9 +25,11 @@
package me.lucko.luckperms.sponge;
import me.lucko.luckperms.api.Tristate;
import me.lucko.luckperms.common.commands.sender.SenderFactory;
import me.lucko.luckperms.common.constants.Constants;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
import me.lucko.luckperms.sponge.service.model.CompatibilityUtil;
import net.kyori.text.Component;
import net.kyori.text.serializer.ComponentSerializer;
@@ -74,6 +76,11 @@ public class SpongeSenderFactory extends SenderFactory<CommandSource> {
}
}
@Override
protected Tristate getPermissionValue(CommandSource source, String node) {
return CompatibilityUtil.convertTristate(source.getPermissionValue(source.getActiveContexts(), node));
}
@Override
protected boolean hasPermission(CommandSource source, String node) {
return source.hasPermission(node);
+9
View File
@@ -102,6 +102,15 @@ temporary-add-behaviour="deny"
# directly and indirectly
primary-group-calculation="parents-by-weight"
# If the plugin should check for "extra" permissions with users run LP commands.
#
# These extra permissions allow finer control over what users can do with each command, and
# who they have access to edit.
#
# The permissions are *not* static, unlike the 'base' permisssions, and will depend upon the
# arguments given within the command.
argument-based-command-permissions=false