From 349a17f664f661acf97896d4b778368edb822044 Mon Sep 17 00:00:00 2001
From: Teravus Ovares
Date: Sat, 17 May 2008 00:16:16 +0000
Subject: * Tweaked patch mantis 1302 and committing it.
---
.../Region/Environment/Scenes/Scene.Inventory.cs | 2 +-
.../Scenes/SceneObjectGroup.Inventory.cs | 4 +--
.../Scenes/SceneObjectPart.Inventory.cs | 37 ++++++++++++++++++----
3 files changed, 33 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 88f0cb4..8b94100 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -769,7 +769,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (XferManager != null)
{
- group.RequestInventoryFile(primLocalID, XferManager);
+ group.RequestInventoryFile(remoteClient, primLocalID, XferManager);
}
}
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index c26ff51..d35765c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -157,12 +157,12 @@ namespace OpenSim.Region.Environment.Scenes
///
///
///
- public void RequestInventoryFile(uint localID, IXfer xferManager)
+ public void RequestInventoryFile(IClientAPI client, uint localID, IXfer xferManager)
{
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
- part.RequestInventoryFile(xferManager);
+ part.RequestInventoryFile(client, xferManager);
}
else
{
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index a9dc9cf..8c5737c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -484,7 +484,7 @@ namespace OpenSim.Region.Environment.Scenes
/// Serialize all the metadata for the items in this prim's inventory ready for sending to the client
///
///
- public void RequestInventoryFile(IXfer xferManager)
+ public void RequestInventoryFile(IClientAPI client, IXfer xferManager)
{
byte[] fileData = new byte[0];
@@ -497,23 +497,45 @@ namespace OpenSim.Region.Environment.Scenes
{
foreach (TaskInventoryItem item in m_taskInventory.Values)
{
+ LLUUID ownerID=item.OwnerID;
+ uint everyoneMask=0;
+ uint baseMask=item.BaseMask;
+ uint ownerMask=item.OwnerMask;
+
+ if(item.InvType == 10) // Script
+ {
+ if((item.OwnerID != client.AgentId) && m_parentGroup.Scene.ExternalChecks.ExternalChecksCanViewScript(item.ItemID, UUID, client.AgentId))
+ {
+ ownerID=client.AgentId;
+ baseMask=0x7fffffff;
+ ownerMask=0x7fffffff;
+ everyoneMask=(uint)(PermissionMask.Move | PermissionMask.Transfer);
+ }
+ if((item.OwnerID != client.AgentId) && m_parentGroup.Scene.ExternalChecks.ExternalChecksCanEditScript(item.ItemID, UUID, client.AgentId))
+ {
+ ownerID=client.AgentId;
+ baseMask=0x7fffffff;
+ ownerMask=0x7fffffff;
+ everyoneMask=(uint)(PermissionMask.Move | PermissionMask.Transfer | PermissionMask.Modify);
+ }
+ }
+
invString.AddItemStart();
invString.AddNameValueLine("item_id", item.ItemID.ToString());
invString.AddNameValueLine("parent_id", UUID.ToString());
invString.AddPermissionsStart();
- invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask));
- invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask));
- invString.AddNameValueLine("group_mask", "00000000");
- invString.AddNameValueLine("everyone_mask", "00000000");
+ invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(baseMask));
+ invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(ownerMask));
+ invString.AddNameValueLine("group_mask", Helpers.UIntToHexString(0));
+ invString.AddNameValueLine("everyone_mask", Helpers.UIntToHexString(everyoneMask));
invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask));
invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
- invString.AddNameValueLine("owner_id", item.OwnerID.ToString());
+ invString.AddNameValueLine("owner_id", ownerID.ToString());
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
-// invString.AddNameValueLine("last_owner_id", item.OwnerID.ToString());
invString.AddNameValueLine("group_id", item.GroupID.ToString());
invString.AddSectionEnd();
@@ -538,6 +560,7 @@ namespace OpenSim.Region.Environment.Scenes
fileData = Helpers.StringToField(invString.BuildString);
+ //Console.WriteLine(Helpers.FieldToUTF8String(fileData));
//m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Helpers.FieldToUTF8String(fileData));
if (fileData.Length > 2)
--
cgit v1.1