feat: bridge permissions into the platforms' native command gates#11
Merged
Conversation
The snapshot was loaded and then consulted by nobody but this plugin's own /permissions commands. On Velocity there was no PermissionsSetupEvent subscriber at all, so source.hasPermission() -- the API every other plugin gates on -- fell through to Velocity's default provider and denied everything for non-console senders. A player holding "*" could not even see /agones in tab-completion, and plugin-chat, plugin-proxy and plugin-social were gated the same way. Every permission check on the network was dead. Velocity: install a PermissionProvider backed by the snapshot, wrapping the previous provider as a fallback so the console keeps its own. A permission the snapshot does not ALLOW falls through to that fallback rather than being modeled as a hard DENY -- Velocity's default answers UNDEFINED for a player, so the check is false either way. Minestom has no permission API whatsoever (no hasPermission on CommandSender, only the vanilla op-level int), so there is nothing to hook. Its native gate is CommandCondition, so ship one factory -- Permissions.commandCondition(node) -- that a gamemode attaches to a command. Permissions is already in the runtime ServiceRegistry, so no runtime change is needed.
This was referenced Jul 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
The permission snapshot was loaded — and then consulted by nobody except this plugin's own
/permissionscommands.On Velocity there is no
PermissionsSetupEventsubscriber at all, so noPermissionProvideris ever installed.source.hasPermission(...)— Velocity's native API, which every other plugin gates on — falls through to Velocity's default provider, which denies everything for non-console senders.plugin-agones,AgonesCommand.kt:59:So a player holding
*cannot even see/agones— Velocity hides commands whosehasPermissionreturns false from tab-completion.plugin-chat(StaffChat, ProxyCommand),plugin-proxyandplugin-socialgate the same way. In effect every permission check on the network was dead, and everything fell back to console-only.Velocity
Installs a
SnapshotPermissionProviderviaPermissionsSetupEvent, wrapping the provider that was there before as a fallback:Playersubjects (the console) fall through unchanged, so the console keeps all its permissionsProxyInitializeEvent, the subscriber is a no-op and the console keeps the default provider — no NPE, no lockoutMinestom
Minestom has no permission API — verified against the pinned jar (
2026.06.20-26.1.2): zero permission classes,CommandSenderhas nohasPermission, onlyPlayer.getPermissionLevel(): Int(the vanilla op tier). There is nothing to hook.Its one native gate is
CommandCondition.canUse, so this ships a single factory:Permissionsis already registered in the runtimeServiceRegistry, so no runtime change is needed.Verification
./gradlew buildgreen. 6 new tests: allow → TRUE, no-grant → falls through to fallback, console → fallback unchanged (Velocity); allows/denies a player, allows console (Minestom).