@Override
        public boolean test(CommandSourceStack source) {
            if (source.getEntity() instanceof ServerPlayer player) {

                User user = this.plugin.getUserManager().getIfLoaded(player.getUUID());
                if (user == null) {
                    return false;
                }

                QueryOptions queryOptions = this.plugin.getContextManager().getQueryOptions(player);
                Tristate state = user.getCachedData().getPermissionData(queryOptions).checkPermission(this.permission);

                if (state != Tristate.UNDEFINED) {
                    return state.asBoolean() && this.delegate.test(source.withPermission(4));
                }
            }

            return this.delegate.test(source);
        }
Injected {@link CommandNode#getRequirement() requirement} that checks for a permission, before
delegating to the existing requirement.
neoforge/src/main/java/me/lucko/luckperms/neoforge/util/BrigadierInjector.java