Skip to content

Conduit permissions

ConduitPermissions is a pluggable permission check used by every engine-side op-gated action. The default policy is “op level 2 (GAMEMASTERS) for everything”; servers running with LuckPerms or any other permission system replace the policy once at startup via setPolicy. Capabilities are stable string names — never integer levels — so backends can match by glob and ops can grant capabilities individually.

The class is named ConduitPermissions in the source (inventory listed it as EnginePermissions; the engine rebrand renamed it).

  • You’re gating an operator action behind a capability check.
  • You want to integrate with LuckPerms or FabricPermissions without forking the engine.
  • You’re defining your own mod-level capabilities and want them to flow through the same policy.
package me.zlex.conduit.permission;
public final class ConduitPermissions {
// Engine-defined capability names.
public static final String CAP_EDITOR_TOGGLE = "conduit.editor.toggle";
public static final String CAP_HUB_TELEPORT_FORCE = "conduit.hub.teleport-force";
public static final String CAP_INSTANCE_DEBUG = "conduit.instance.debug";
@FunctionalInterface
public interface Policy {
boolean can(ServerPlayer player, String capability);
}
public static synchronized void setPolicy(Policy policy);
public static boolean can(ServerPlayer player, String capability);
}

Any string is a valid capability — pick a namespaced one for your mod ("sprint-race.leaderboard.reset") and route every gate through can.

import me.zlex.conduit.permission.ConduitPermissions;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
public final class SprintRaceCommands {
public static final String CAP_RESET = "sprint-race.leaderboard.reset";
public static int leaderboardReset(CommandSourceStack source, ServerPlayer p) {
if (!ConduitPermissions.can(p, CAP_RESET)) {
source.sendFailure(Component.literal("You can't do that."));
return 0;
}
SprintRaceMod.STATE.clearLeaderboard();
source.sendSuccess(() -> Component.literal("Leaderboard cleared."), true);
return 1;
}
}

A LuckPerms-shaped integration only has to call setPolicy once:

ConduitPermissions.setPolicy((player, cap) ->
LuckPermsBridge.holdsPermission(player.getUUID(), cap));
  • setPolicy is idempotent — call it once in your permissions-bridge mod’s onInitialize.
  • The default policy uses the vanilla GAMEMASTERS permission level. If you’re on a single-op test server, that just maps to /op.
  • There is no built-in “deny” list — policy implementations own the deny logic.