Define scenario permissions for legacy role actions

The role system is moving onto clusterio's own roles and permissions, which
requires every in game action to exist as a real permission rather than a bare
string held only by the lua config.

Adds a permission for each of the 104 actions and 7 flags used by the legacy
role config. Names are derived from the legacy action by a deterministic
transform, exported so the lua side can apply the same mapping and keep existing
call sites working. Command descriptions are taken from the existing locale
entries so they match what players already see.

Actions held by the Guest role are marked grantByDefault, since the in game
default role and clusterio's default role are the same concept.

Role management actions have no scenario permission; they map onto
core.user.update_roles and core.role.list instead.

Also corrects the /unjail description, which was a copy of /jail.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-07-31 09:11:26 +00:00
co-authored by Claude Opus 5
parent a07be7b7ed
commit e852abc309
3 changed files with 164 additions and 1 deletions
+3
View File
@@ -1,6 +1,9 @@
import * as lib from "@clusterio/lib";
// import * as Messages from "./messages";
// Defines a permission for every in game action and role flag used by the scenario
import "./permissions";
lib.definePermission({
name: "exp_scenario.config.view",
title: "View ExpScenario Config",