From 428998889e9bb60c7dc46388184b07c489ddaeb2 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 4 Dec 2025 01:26:30 +0500 Subject: feat: trusted users --- bot/src/commands/lua.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bot/src/commands/lua.hpp') 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( 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) { -- cgit v1.2.3