diff options
author | Diva Canto | 2013-08-03 20:36:30 -0700 |
---|---|---|
committer | Diva Canto | 2013-08-03 20:36:30 -0700 |
commit | 09cb2a37dd73296290c306f38412c1743b9eb820 (patch) | |
tree | 07eed4e123986d782212aa7f8bec60040c2b6711 /OpenSim | |
parent | HG: If OutboundPermission is set to false, let's enforce stricter permissions... (diff) | |
download | opensim-SC_OLD-09cb2a37dd73296290c306f38412c1743b9eb820.zip opensim-SC_OLD-09cb2a37dd73296290c306f38412c1743b9eb820.tar.gz opensim-SC_OLD-09cb2a37dd73296290c306f38412c1743b9eb820.tar.bz2 opensim-SC_OLD-09cb2a37dd73296290c306f38412c1743b9eb820.tar.xz |
More on HG inventory and OutboundPermission: disallowing giving inventory to foreigners if OutboundPermission is false
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 3 |
2 files changed, 15 insertions, 1 deletions
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 | |||
124 | // We're fgoing to enforce some stricter permissions if Outbound is false | 124 | // We're fgoing to enforce some stricter permissions if Outbound is false |
125 | scene.Permissions.OnTakeObject += CanTakeObject; | 125 | scene.Permissions.OnTakeObject += CanTakeObject; |
126 | scene.Permissions.OnTakeCopyObject += CanTakeObject; | 126 | scene.Permissions.OnTakeCopyObject += CanTakeObject; |
127 | 127 | scene.Permissions.OnTransferUserInventory += OnTransferUserInventory; | |
128 | } | 128 | } |
129 | 129 | ||
130 | #endregion | 130 | #endregion |
@@ -447,6 +447,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
447 | return true; | 447 | return true; |
448 | } | 448 | } |
449 | 449 | ||
450 | private bool OnTransferUserInventory(UUID itemID, UUID userID, UUID recipientID) | ||
451 | { | ||
452 | if (m_bypassPermissions) return true; | ||
453 | |||
454 | if (!m_OutboundPermission && !UserManagementModule.IsLocalGridUser(recipientID)) | ||
455 | return false; | ||
456 | |||
457 | return true; | ||
458 | } | ||
459 | |||
460 | |||
450 | #endregion | 461 | #endregion |
451 | } | 462 | } |
452 | } \ No newline at end of file | 463 | } \ 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 | |||
556 | { | 556 | { |
557 | //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); | 557 | //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); |
558 | 558 | ||
559 | if (!Permissions.CanTransferUserInventory(itemId, senderId, recipient)) | ||
560 | return null; | ||
561 | |||
559 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); | 562 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); |
560 | item = InventoryService.GetItem(item); | 563 | item = InventoryService.GetItem(item); |
561 | 564 | ||