mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/RBAC: Add two side trade to RBAC
This commit is contained in:
9
sql/updates/auth/2014_12_16_00_auth.sql
Normal file
9
sql/updates/auth/2014_12_16_00_auth.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
-- Add rbac_permissions
|
||||
DELETE FROM `rbac_permissions` WHERE `id` = 51;
|
||||
INSERT INTO `rbac_permissions` (`id`,`name`) VALUES
|
||||
(51, 'Allow trading between factions');
|
||||
|
||||
-- Add rbac_linked_permissions
|
||||
DELETE FROM `rbac_linked_permissions` WHERE `linkedId` = 51;
|
||||
INSERT INTO `rbac_linked_permissions` (`id`,`linkedId`) VALUES
|
||||
(194, 51);
|
||||
@@ -100,6 +100,7 @@ enum RBACPermissions
|
||||
RBAC_PERM_COMMANDS_PINFO_CHECK_PERSONAL_DATA = 48,
|
||||
RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE = 49,
|
||||
RBAC_PERM_MAY_CHECK_OWN_EMAIL = 50,
|
||||
RBAC_PERM_ALLOW_TWO_SIDE_TRADE = 51,
|
||||
|
||||
// Free space for core permissions (till 149)
|
||||
// Roles (Permissions with delegated permissions) use 199 and descending
|
||||
|
||||
@@ -676,7 +676,9 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) && pOther->GetTeam() !=_player->GetTeam())
|
||||
if (pOther->GetTeam() != _player->GetTeam() &&
|
||||
(!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) &&
|
||||
!GetPlayer()->GetSession()->HasPermission(rbac::RBAC_PERM_ALLOW_TWO_SIDE_TRADE)))
|
||||
{
|
||||
info.Status = TRADE_STATUS_WRONG_FACTION;
|
||||
SendTradeStatus(info);
|
||||
|
||||
Reference in New Issue
Block a user