Closed RedRafe closed 7 months ago
@grilledham I've refactored the whole module and come to a satisfying conclusion.
The config module permissions
turns ON/OFF globally the feature from enabled
flag, as per any other config field; by default it's globally enabled but no sub-preset is turned on (so no restriction is applied to generic scenarios). Each DO scenario simply enables a permission preset by calling Config.permissions.presets.no_blueprints = true
For single-player-use when downloading from GitHub, they can disable/enable the no-BPs (or any other future preset, individually) from the config file.
An additional method for on_player_joined
event is also implemented, tho not used, for future edge cases we might encounter.
Additionally, 2 commands have also been added to provide support for single-users and RedMew servers CLI:
/permissions-reset
- reset all users permissions to default (admin/server only)/permissions-set-scenario
- to reapply the scenario's restrictions, if any (admin/server only)This should give us plenty of room to expand for future applications, has global ON/OFF from config file so it's easy to manipulate, quick to use from scenario templates, & backed by admin commands in case emergency actions need to be taken. From in-game, & remotely.