diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-04 01:26:30 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-04 01:26:30 +0500 |
| commit | 428998889e9bb60c7dc46388184b07c489ddaeb2 (patch) | |
| tree | 872a11239eebbf930c85d846f7cec9f828a43ab5 /bot/src/commands/lua.hpp | |
| parent | 638622d66dbe58ff96b7d1c2c6ec4b040b27da6d (diff) | |
feat: trusted users
Diffstat (limited to 'bot/src/commands/lua.hpp')
| -rw-r--r-- | bot/src/commands/lua.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/src/commands/lua.hpp b/bot/src/commands/lua.hpp index 2f236f2..1a1c9f9 100644 --- a/bot/src/commands/lua.hpp +++ b/bot/src/commands/lua.hpp @@ -97,7 +97,8 @@ namespace bot::command::lua { command::Response run(const InstanceBundle& bundle, const command::Request& request) const override { - if (!bundle.configuration.lua.allow_arbitrary_scripts) { + if (!bundle.configuration.lua.allow_arbitrary_scripts && + request.requester.user_rights.get_level() < schemas::TRUSTED) { throw ResponseException<ResponseError::ILLEGAL_COMMAND>( request, bundle.localization); } @@ -126,6 +127,7 @@ namespace bot::command::lua { } if (!bundle.configuration.lua.allow_arbitrary_scripts && + request.requester.user_rights.get_level() < schemas::TRUSTED && !std::any_of(bundle.configuration.lua.script_whitelist.begin(), bundle.configuration.lua.script_whitelist.end(), [&request](const std::string& i) { |
