reverting #7295, as it still fails a test case (as pointed out very

kindly by sean) --- lesson learned: just running a "make test" is not
sufficient, you need to precede it by a "make clean".
0.6.1-post-fixes
Dr Scofield 2008-11-14 13:03:18 +00:00
parent 5e20e32b69
commit 5c21ec6d10
7 changed files with 23 additions and 59 deletions

View File

@ -591,9 +591,7 @@ namespace OpenSim.Data.Tests
Assert.That(t.ItemID,Is.EqualTo(id));
Assert.That(t.LastOwnerID, Is.EqualTo(sog.RootPart.LastOwnerID));
Assert.That(t.NextPermissions, Is.EqualTo(nextperm));
// Ownership changes when you drop an object into an object
// owned by someone else
Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID));
Assert.That(t.OwnerID,Is.EqualTo(owner));
Assert.That(t.CurrentPermissions, Is.EqualTo(curperm));
Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID));
Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID));
@ -850,4 +848,4 @@ namespace OpenSim.Data.Tests
// return f;
// }
}
}
}

View File

@ -277,7 +277,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
public bool PropagatePermissions()
{
return !m_bypassPermissions;
return false;
}
public bool BypassPermissions()

View File

@ -1179,8 +1179,7 @@ namespace OpenSim.Region.Environment.Scenes
destTaskItem.InvType = srcTaskItem.InvType;
destTaskItem.Type = srcTaskItem.Type;
destPart.AddInventoryItem(destTaskItem, part.OwnerID!=destPart.OwnerID
&& ExternalChecks.ExternalChecksPropagatePermissions());
destPart.AddInventoryItem(destTaskItem);
if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
part.RemoveInventoryItem(itemId);
@ -1250,16 +1249,11 @@ namespace OpenSim.Region.Environment.Scenes
if (part != null)
{
TaskInventoryItem currentItem = part.GetInventoryItem(itemID);
bool allowInventoryDrop = (part.GetEffectiveObjectFlags()
& (uint)PrimFlags.AllowInventoryDrop) != 0;
// Explicity allow anyone to add to the inventory if the AllowInventoryDrop
// flag has been set. Don't however let them update an item unless
// they pass the external checks
if (!ExternalChecks.ExternalChecksCanEditObjectInventory(part.UUID, remoteClient.AgentId)
&& (currentItem != null || !allowInventoryDrop ))
if (!ExternalChecks.ExternalChecksCanEditObjectInventory(part.UUID, remoteClient.AgentId))
return;
TaskInventoryItem currentItem = part.GetInventoryItem(itemID);
if (currentItem == null)
{
UUID copyID = UUID.Random();
@ -1423,7 +1417,7 @@ namespace OpenSim.Region.Environment.Scenes
taskItem.PermsMask = 0;
taskItem.AssetID = asset.FullID;
part.AddInventoryItem(taskItem, false);
part.AddInventoryItem(taskItem);
part.GetProperties(remoteClient);
part.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
@ -1518,7 +1512,7 @@ namespace OpenSim.Region.Environment.Scenes
destTaskItem.InvType = srcTaskItem.InvType;
destTaskItem.Type = srcTaskItem.Type;
destPart.AddInventoryItemExclusive(destTaskItem, false);
destPart.AddInventoryItemExclusive(destTaskItem);
if (running > 0)
{

View File

@ -151,42 +151,23 @@ namespace OpenSim.Region.Environment.Scenes
taskItem.AssetID = item.AssetID;
taskItem.Name = item.Name;
taskItem.Description = item.Description;
taskItem.OwnerID = part.OwnerID; // Transfer ownership
taskItem.OwnerID = item.Owner;
taskItem.CreatorID = item.Creator;
taskItem.Type = item.AssetType;
taskItem.InvType = item.InvType;
if (remoteClient!=null && remoteClient.AgentId!=part.OwnerID &&
m_scene.ExternalChecks.ExternalChecksPropagatePermissions()) {
taskItem.BasePermissions = item.BasePermissions & item.NextPermissions;
taskItem.CurrentPermissions = item.CurrentPermissions & item.NextPermissions;
taskItem.EveryonePermissions = item.EveryOnePermissions & item.NextPermissions;
taskItem.NextPermissions = item.NextPermissions;
taskItem.CurrentPermissions |= 8;
} else {
taskItem.BasePermissions = item.BasePermissions;
taskItem.CurrentPermissions = item.CurrentPermissions;
taskItem.CurrentPermissions |= 8;
taskItem.EveryonePermissions = item.EveryOnePermissions;
taskItem.NextPermissions = item.NextPermissions;
}
taskItem.BasePermissions = item.BasePermissions;
taskItem.CurrentPermissions = item.CurrentPermissions;
// FIXME: ignoring group permissions for now as they aren't stored in item
taskItem.EveryonePermissions = item.EveryOnePermissions;
taskItem.NextPermissions = item.NextPermissions;
taskItem.Flags = item.Flags;
// TODO: These are pending addition of those fields to TaskInventoryItem
// taskItem.SalePrice = item.SalePrice;
// taskItem.SaleType = item.SaleType;
taskItem.CreationDate = (uint)item.CreationDate;
bool addFromAllowedDrop = false;
if (remoteClient!=null)
{
addFromAllowedDrop = remoteClient.AgentId!=part.OwnerID &&
m_scene.ExternalChecks.ExternalChecksPropagatePermissions();
}
part.AddInventoryItem(taskItem, addFromAllowedDrop);
part.AddInventoryItem(taskItem);
return true;
}

View File

@ -289,16 +289,16 @@ namespace OpenSim.Region.Environment.Scenes
/// name is chosen.
/// </summary>
/// <param name="item"></param>
public void AddInventoryItem(TaskInventoryItem item, bool allowedDrop)
public void AddInventoryItem(TaskInventoryItem item)
{
AddInventoryItem(item.Name, item, allowedDrop);
AddInventoryItem(item.Name, item);
}
/// <summary>
/// Add an item to this prim's inventory. If an item with the same name already exists, it is replaced.
/// </summary>
/// <param name="item"></param>
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
public void AddInventoryItemExclusive(TaskInventoryItem item)
{
List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_taskInventory.Values);
foreach (TaskInventoryItem i in il)
@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes
}
}
AddInventoryItem(item.Name, item, allowedDrop);
AddInventoryItem(item.Name, item);
}
/// <summary>
@ -324,10 +324,7 @@ namespace OpenSim.Region.Environment.Scenes
/// The item itself. The name within this structure is ignored in favour of the name
/// given in this method's arguments
/// </param>
/// <param name="allowedDrop">
// Item was only added to inventory because AllowedDrop is set
/// </param>
protected void AddInventoryItem(string name, TaskInventoryItem item, bool allowedDrop)
protected void AddInventoryItem(string name, TaskInventoryItem item)
{
name = FindAvailableInventoryName(name);
if (name == String.Empty)
@ -340,10 +337,7 @@ namespace OpenSim.Region.Environment.Scenes
lock (m_taskInventory)
{
m_taskInventory.Add(item.ItemID, item);
if (allowedDrop)
TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
else
TriggerScriptChangedEvent(Changed.INVENTORY);
TriggerScriptChangedEvent(Changed.INVENTORY);
}
m_inventorySerial++;

View File

@ -4006,9 +4006,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.ParentGroup.RootPart.AllowedDrop = true;
else
m_host.ParentGroup.RootPart.AllowedDrop = false;
// Update the object flags
m_host.ParentGroup.RootPart.aggregateScriptEvents();
}
public LSL_Vector llGetSunDirection()

View File

@ -1014,7 +1014,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
taskItem.PermsMask = 0;
taskItem.AssetID = asset.FullID;
m_host.AddInventoryItem(taskItem, false);
m_host.AddInventoryItem(taskItem);
}
}
}