Please sign in to comment.
Improve permission resolution of RootCommand's
ACF's permission tree can go more complex where a single root command may have multiple dependent perm nodes. So essentially ACF does not assign permission nodes to root in bukkit and the such in a reasonable manner. With this commit, we try to identify a single unique permission node, and assign that permission node as the node to use where applicable. In Bukkit/Sponge, we implement testPermission instead, which does a smarter look up of all potential commands that root command might execute for the given issuer, and if they have permission to any of them, then pass as true. This is much more accurate, so if the issuer has access to no subcommand then the root command should not be revealed anymore in Bukkit or Sponge. In bungee, we are best guess at the unique perm node, and if there is any ambiguity, it will be null and seen by everyone (but still enforces permission checks)
- Loading branch information...
Showing with 103 additions and 20 deletions.
- +7 −2 bukkit/src/main/java/co/aikar/commands/BukkitRootCommand.java
- +7 −0 bungee/src/main/java/co/aikar/commands/BungeeRootCommand.java
- +9 −5 core/src/main/java/co/aikar/commands/BaseCommand.java
- +28 −4 core/src/main/java/co/aikar/commands/ForwardingCommand.java
- +9 −6 core/src/main/java/co/aikar/commands/RegisteredCommand.java
- +41 −1 core/src/main/java/co/aikar/commands/RootCommand.java
- +2 −2 sponge/src/main/java/co/aikar/commands/SpongeRootCommand.java