Skip to content
Permalink
Browse files

compute BaseCommand permissions before RegisteredCommands

Need to be computed for inheritance
  • Loading branch information...
aikar committed Mar 15, 2019
1 parent 4e9fce5 commit 42867fe194d1784bc2419694e9b2ab2ef8efb70c
@@ -252,8 +252,8 @@ private void onRegister(CommandManager manager, String cmd) {
this.parentSubcommand = getParentSubcommand(self);
this.conditions = annotations.getAnnotationValue(self, Conditions.class, Annotations.REPLACEMENTS | Annotations.NO_EMPTY);

computePermissions(); // Must be before any subcommands so they can inherit permissions
registerSubcommands();
computePermissions();
registerSubclasses(cmd);

if (cmdAliases != null) {
@@ -4,6 +4,7 @@
import co.aikar.commands.CommandHelp;
import co.aikar.commands.annotation.CatchUnknown;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Default;
import co.aikar.commands.annotation.HelpCommand;
import co.aikar.commands.annotation.Single;
@@ -12,9 +13,11 @@
import org.bukkit.entity.Player;

@CommandAlias("soctest")
@CommandPermission("soc.parent")
public class SomeOtherCommand extends BaseCommand {

@Subcommand("foo")
@CommandPermission("soc.foo")
public void onFoo1(Player player) {
player.sendMessage("you foo'd");
}

0 comments on commit 42867fe

Please sign in to comment.
You can’t perform that action at this time.