Move the seed into exp_scenario and seed the permission groups - #457
Open
bbassie wants to merge 1 commit into
Open
Move the seed into exp_scenario and seed the permission groups#457bbassie wants to merge 1 commit into
bbassie wants to merge 1 commit into
Conversation
The seed roles were owned by exp_roles, but they describe the scenario, so they now live in exp_scenario/seed.ts next to the permissions they grant. Each seed role names the permission group its holders belong to, and the five groups the legacy config defined (Admin, Trusted, Standard, Guest, Restricted) are seeded through exp_groups along with one role mapping per role. Mapping priorities follow how exp_roles ranks a player's highest role, so Jail lands in Restricted regardless of other roles. SeedRolesRequest becomes exp_scenario's SeedRequest behind a new exp_scenario.seed permission, and the button moves to the scenario's web plugin, which gets a web entrypoint for it. exp_roles no longer depends on exp_scenario, and exp_scenario gains controller tests around the seed. With groups seeded from the controller the legacy expcore.permission_groups module and its config are removed, along with the Group rcon static.
bbassie
force-pushed
the
feature/seed-groups
branch
from
September 6, 2026 16:46
4174f86 to
2bdf64c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to #453. The seed roles were owned by exp_roles but describe the scenario, so they now live in
exp_scenario/seed.tsnext to the permissions they grant. Each seed role names the permission group its holders belong to, and the five groups the legacy config defined (Admin, Trusted, Standard, Guest, Restricted) are seeded through exp_groups with one role mapping per role. Mapping priorities follow how exp_roles ranks a player's highest role (priority, then order), so Jail lands in Restricted no matter what else the player holds. System has no group and stays in Factorio's Default group, matching the oldset_permission_group("Default", true).SeedRolesRequestbecomesSeedRequestin exp_scenario behind a newexp_scenario.seedpermission, and the button moves to the scenario's web plugin (which gains a web entrypoint), still rendered on the roles page. Re-seeding reuses roles by name and only adds permissions, resets groups by name to the seed, reuses the mapping of each seed role, and skips priorities held by other mappings.With groups seeded from the controller the legacy
expcore.permission_groupsmodule, its config, the_file_loaderentry and theGrouprcon static are removed. exp_roles no longer needs its devDependency on exp_scenario; exp_scenario depends on@expcluster/rolesand@expcluster/permission-groupsinstead.Tests moved with the seed and grew a controller test that runs the seed against a real
Controllerwith both sibling plugins loaded (pnpm --filter @expcluster/scenario test, 592 assertions; exp_roles still passes with 523). Lua lint is clean.Smoke tested on my dev cluster against a database that already had the roles and a hand made group mapped at priority 100: the seed created 5 groups and 14 mappings, left the priority 100 mapping alone, re-seeding was idempotent, and the instance showed all five groups in game with the expected allowed action counts (Restricted allows only
write_to_console).