aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2013-02-25 12:10:16 +0100
committerSpp <spp@jorge.gr>2013-02-25 15:48:18 +0100
commite6087b5563916cf21a949652ce62e1439d7f1b78 (patch)
treeeafb49d1e1ef6b979cae59475a113109b31e7e8d /src/server/scripts/Commands
parent1638092f18c0fd13e4e092a5d6eb23becfb8ae23 (diff)
Core/RBAC: Create new permission 'Be assigned ticket'
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_ticket.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp
index aee01f47581..958eb1709d5 100644
--- a/src/server/scripts/Commands/cs_ticket.cpp
+++ b/src/server/scripts/Commands/cs_ticket.cpp
@@ -95,18 +95,16 @@ public:
return true;
}
- // Get target information
- uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target.c_str());
- uint64 targetAccountId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
- uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccountId, realmID);
-
+ uint32 accountId = AccountMgr::GetId(target);
// Target must exist and have administrative rights
- if (!targetGuid || AccountMgr::IsPlayerAccount(targetGmLevel))
+ if (!AccountMgr::HasPermission(accountId, RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET, realmID))
{
handler->SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
return true;
}
+ uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target);
+
// If already assigned, leave
if (ticket->IsAssignedTo(targetGuid))
{
@@ -125,7 +123,7 @@ public:
// Assign ticket
SQLTransaction trans = SQLTransaction(NULL);
- ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(targetGmLevel));
+ ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(AccountMgr::GetSecurity(accountId, realmID)));
ticket->SaveToDB(trans);
sTicketMgr->UpdateLastChange();