More on HG inventory and OutboundPermission: disallowing giving inventory to foreigners if OutboundPermission is false

TeleportWork
Diva Canto 2013-08-03 20:36:30 -07:00
parent dcfeb95e98
commit 09cb2a37dd
2 changed files with 15 additions and 1 deletions

View File

@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// We're fgoing to enforce some stricter permissions if Outbound is false // We're fgoing to enforce some stricter permissions if Outbound is false
scene.Permissions.OnTakeObject += CanTakeObject; scene.Permissions.OnTakeObject += CanTakeObject;
scene.Permissions.OnTakeCopyObject += CanTakeObject; scene.Permissions.OnTakeCopyObject += CanTakeObject;
scene.Permissions.OnTransferUserInventory += OnTransferUserInventory;
} }
#endregion #endregion
@ -447,6 +447,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return true; 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 #endregion
} }
} }

View File

@ -556,6 +556,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
//Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem");
if (!Permissions.CanTransferUserInventory(itemId, senderId, recipient))
return null;
InventoryItemBase item = new InventoryItemBase(itemId, senderId); InventoryItemBase item = new InventoryItemBase(itemId, senderId);
item = InventoryService.GetItem(item); item = InventoryService.GetItem(item);