diff options
author | Spp <spp@jorge.gr> | 2013-02-25 13:40:56 +0100 |
---|---|---|
committer | Spp <spp@jorge.gr> | 2013-02-25 15:48:18 +0100 |
commit | fc78c48495661dc1e8393c637028971c8126a680 (patch) | |
tree | 723b3879280b7824dd1c61e75076d93cd2dbc791 /src/server/game/Chat/Chat.cpp | |
parent | d14cb26e6e608902e10f6935ec3de86962e32738 (diff) |
Core/RBAC: Create new permissions 'Notify if a command was not found' and 'Enables lower security than target check'
Diffstat (limited to 'src/server/game/Chat/Chat.cpp')
-rw-r--r-- | src/server/game/Chat/Chat.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 3cae9d0f83a..7c92af2d67f 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -175,7 +175,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac return false; // ignore only for non-players for non strong checks (when allow apply command at least to same sec level) - if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()) && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY)) + if (m_session->HasPermission(RBAC_PERM_CHECK_FOR_LOWER_SECURITY) && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY)) return false; if (target) @@ -361,6 +361,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, co // table[i].Name == "" is special case: send original command to handler if ((table[i].Handler)(this, table[i].Name[0] != '\0' ? text : oldtext)) { + // FIXME: When Command system is moved to RBAC this check must be changed if (!AccountMgr::IsPlayerAccount(table[i].SecurityLevel)) { // chat case @@ -476,7 +477,7 @@ bool ChatHandler::ParseCommands(char const* text) if (!ExecuteCommandInTable(getCommandTable(), text, fullcmd)) { - if (m_session && AccountMgr::IsPlayerAccount(m_session->GetSecurity())) + if (m_session && !m_session->HasPermission(RBAC_PERM_COMMANDS_NOTIFY_COMMAND_NOT_FOUND_ERROR)) return false; SendSysMessage(LANG_NO_CMD); |