From 7def786ef4d62c2ffad8cea0cba7db033f8f0d27 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Mon, 22 Sep 2008 11:20:09 +0000 Subject: cleanups in inventory REST code. also, disables digest authentications for inventory REST calls for the time being, as firefox, curl, and also python's urllib2 cannot authenticate using digest auth. fix permission checking for prim inventory to be the same as for normal edit ops. --- .../Region/Environment/Scenes/Scene.Inventory.cs | 30 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index c670076..a188701 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -1186,11 +1186,21 @@ namespace OpenSim.Region.Environment.Scenes if (part != null) { - if (part.OwnerID != remoteClient.AgentId) - return; - if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) - return; + // replacing the following two checks with the + // ExternalChecks.ExternalChecksCanEditObject(...) + // call + + // if (part.OwnerID != remoteClient.AgentId) + // return; + + // if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) + // return; + + if (!ExternalChecks.ExternalChecksCanEditObject(part.UUID, remoteClient.AgentId)) + { + return; + } TaskInventoryItem currentItem = part.GetInventoryItem(itemID); @@ -1283,11 +1293,23 @@ System.Console.WriteLine("Item asset {0}, request asset {1}", prevItem.AssetID.T SceneObjectPart part = GetSceneObjectPart(localID); if (part != null) { + + /* if (part.OwnerID != remoteClient.AgentId) + { return; + } if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) + { return; + } + */ + + if (!ExternalChecks.ExternalChecksCanEditObject(part.UUID, remoteClient.AgentId)) + { + return; + } part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID); // TODO: set this to "true" when scripts in inventory have persistent state to fire on_rez -- cgit v1.1