mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-12 16:35:11 +09:00
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>
40 lines
905 B
TypeScript
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",
|
|
],
|
|
*/
|
|
};
|