feat(Core/RBAC): Role Based Access Controls (#24641)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
Co-authored-by: Spp <spp@jorge.gr>
Co-authored-by: Spp <spp@tc.plus>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-05-01 07:19:30 -05:00
committed by GitHub
parent a783e6c436
commit 779331fc4b
97 changed files with 6276 additions and 1089 deletions

View File

@@ -25,6 +25,7 @@
#include "ModuleMgr.h"
#include "MotdMgr.h"
#include "MySQLThreading.h"
#include "RBAC.h"
#include "Realm.h"
#include "StringConvert.h"
#include "UpdateTime.h"
@@ -48,44 +49,44 @@ public:
{
static ChatCommandTable serverIdleRestartCommandTable =
{
{ "cancel", HandleServerShutDownCancelCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "", HandleServerIdleRestartCommand, SEC_CONSOLE, Console::Yes }
{ "cancel", HandleServerShutDownCancelCommand, rbac::RBAC_PERM_COMMAND_SERVER_IDLERESTART_CANCEL, Console::Yes },
{ "", HandleServerIdleRestartCommand, rbac::RBAC_PERM_COMMAND_SERVER_IDLERESTART, Console::Yes }
};
static ChatCommandTable serverIdleShutdownCommandTable =
{
{ "cancel", HandleServerShutDownCancelCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "", HandleServerIdleShutDownCommand, SEC_CONSOLE, Console::Yes }
{ "cancel", HandleServerShutDownCancelCommand, rbac::RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN_CANCEL, Console::Yes },
{ "", HandleServerIdleShutDownCommand, rbac::RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN, Console::Yes }
};
static ChatCommandTable serverRestartCommandTable =
{
{ "cancel", HandleServerShutDownCancelCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "", HandleServerRestartCommand, SEC_ADMINISTRATOR, Console::Yes }
{ "cancel", HandleServerShutDownCancelCommand, rbac::RBAC_PERM_COMMAND_SERVER_RESTART_CANCEL, Console::Yes },
{ "", HandleServerRestartCommand, rbac::RBAC_PERM_COMMAND_SERVER_RESTART, Console::Yes }
};
static ChatCommandTable serverShutdownCommandTable =
{
{ "cancel", HandleServerShutDownCancelCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "", HandleServerShutDownCommand, SEC_ADMINISTRATOR, Console::Yes }
{ "cancel", HandleServerShutDownCancelCommand, rbac::RBAC_PERM_COMMAND_SERVER_SHUTDOWN_CANCEL, Console::Yes },
{ "", HandleServerShutDownCommand, rbac::RBAC_PERM_COMMAND_SERVER_SHUTDOWN, Console::Yes }
};
static ChatCommandTable serverSetCommandTable =
{
{ "loglevel", HandleServerSetLogLevelCommand, SEC_CONSOLE, Console::Yes },
{ "motd", HandleServerSetMotdCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "closed", HandleServerSetClosedCommand, SEC_CONSOLE, Console::Yes },
{ "loglevel", HandleServerSetLogLevelCommand, rbac::RBAC_PERM_COMMAND_SERVER_SET_LOGLEVEL, Console::Yes },
{ "motd", HandleServerSetMotdCommand, rbac::RBAC_PERM_COMMAND_SERVER_SET_MOTD, Console::Yes },
{ "closed", HandleServerSetClosedCommand, rbac::RBAC_PERM_COMMAND_SERVER_SET_CLOSED, Console::Yes },
};
static ChatCommandTable serverCommandTable =
{
{ "corpses", HandleServerCorpsesCommand, SEC_GAMEMASTER, Console::Yes },
{ "debug", HandleServerDebugCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "exit", HandleServerExitCommand, SEC_CONSOLE, Console::Yes },
{ "corpses", HandleServerCorpsesCommand, rbac::RBAC_PERM_COMMAND_SERVER_CORPSES, Console::Yes },
{ "debug", HandleServerDebugCommand, rbac::RBAC_PERM_COMMAND_SERVER_DEBUG, Console::Yes },
{ "exit", HandleServerExitCommand, rbac::RBAC_PERM_COMMAND_SERVER_EXIT, Console::Yes },
{ "idlerestart", serverIdleRestartCommandTable },
{ "idleshutdown", serverIdleShutdownCommandTable },
{ "info", HandleServerInfoCommand, SEC_PLAYER, Console::Yes },
{ "motd", HandleServerMotdCommand, SEC_PLAYER, Console::Yes },
{ "info", HandleServerInfoCommand, rbac::RBAC_PERM_COMMAND_SERVER_INFO, Console::Yes },
{ "motd", HandleServerMotdCommand, rbac::RBAC_PERM_COMMAND_SERVER_MOTD, Console::Yes },
{ "restart", serverRestartCommandTable },
{ "shutdown", serverShutdownCommandTable },
{ "set", serverSetCommandTable }