Files
factorio-scenario-ExpCluster/exp_scenario/index.ts
T
bbassieandClaude Opus 5 e852abc309 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>
2026-07-31 09:11:26 +00:00

40 lines
905 B
TypeScript

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",
description: "View the config for all submodules of ExpScenario",
});
lib.definePermission({
name: "exp_scenario.config.edit",
title: "Edit ExpScenario Config",
description: "Edit the config for all submodules of ExpScenario",
});
declare module "@clusterio/lib" {
}
export const plugin: lib.PluginDeclaration = {
name: "exp_scenario",
title: "exp_scenario",
description: "Example Description. Plugin. Change me in index.ts",
controllerEntrypoint: "./dist/node/controller",
instanceEntrypoint: "./dist/node/instance",
/*
messages: [
],
webEntrypoint: "./web",
routes: [
"/exp_scenario",
],
*/
};