From 09cb2a37dd73296290c306f38412c1743b9eb820 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 3 Aug 2013 20:36:30 -0700 Subject: More on HG inventory and OutboundPermission: disallowing giving inventory to foreigners if OutboundPermission is false --- .../Framework/InventoryAccess/HGInventoryAccessModule.cs | 13 ++++++++++++- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 978c288..ce7ed26 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // We're fgoing to enforce some stricter permissions if Outbound is false scene.Permissions.OnTakeObject += CanTakeObject; scene.Permissions.OnTakeCopyObject += CanTakeObject; - + scene.Permissions.OnTransferUserInventory += OnTransferUserInventory; } #endregion @@ -447,6 +447,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess return true; } + private bool OnTransferUserInventory(UUID itemID, UUID userID, UUID recipientID) + { + if (m_bypassPermissions) return true; + + if (!m_OutboundPermission && !UserManagementModule.IsLocalGridUser(recipientID)) + return false; + + return true; + } + + #endregion } } \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 2d1a3ef..8e4e307 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -556,6 +556,9 @@ namespace OpenSim.Region.Framework.Scenes { //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); + if (!Permissions.CanTransferUserInventory(itemId, senderId, recipient)) + return null; + InventoryItemBase item = new InventoryItemBase(itemId, senderId); item = InventoryService.GetItem(item); -- cgit v1.1