[Experimental] Don't check for permissions on root parents.

This commit is contained in:
Matthew Miller 2018-09-26 15:41:27 +10:00
parent 42e0cceeab
commit 59584ba10c
2 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ public class SimpleDispatcher implements Dispatcher {
@Override
public Object call(String arguments, CommandLocals locals, String[] parentCommands) throws CommandException {
// We have permission for this command if we have permissions for subcommands
if (!testPermission(locals)) {
if (parentCommands.length != 0 && !testPermission(locals)) {
throw new CommandPermissionsException();
}

View File

@ -182,7 +182,7 @@ class ParametricCallable implements CommandCallable {
@Override
public Object call(String stringArguments, CommandLocals locals, String[] parentCommands) throws CommandException {
// Test permission
if (!testPermission(locals)) {
if (parentCommands.length != 0 && !testPermission(locals)) {
throw new CommandPermissionsException();
}