Partially implement share with group option for object inventory items

If serverside permissions are off then this works as expected.  Previously, it was impossible for more than one person to edit such items even if permissions were off.
If serverside permissions are on then this works as expected if the object was created by an avatar who had the required group active.
However, if the group for the object is later set then the contained item is still not editable.  This may be linked to a wider bug where the object is still not modifiable by the group anyway
slimupdates
Justin Clark-Casey (justincc) 2010-04-05 19:37:02 +01:00
parent ee198eaa11
commit 9ecad50419
4 changed files with 22 additions and 8 deletions

View File

@ -670,7 +670,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
AsyncPacketProcess packetObject = (AsyncPacketProcess)state; AsyncPacketProcess packetObject = (AsyncPacketProcess)state;
packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack); packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack);
} }
#endregion Packet Handling #endregion Packet Handling
@ -7683,12 +7682,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask; newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask;
newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask; newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask;
newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask; newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask;
// Unused? Clicking share with group sets GroupPermissions instead, so perhaps this is something
// different
//newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned; //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned;
newTaskItem.Type = updatetask.InventoryData.Type; newTaskItem.Type = updatetask.InventoryData.Type;
newTaskItem.InvType = updatetask.InventoryData.InvType; newTaskItem.InvType = updatetask.InventoryData.InvType;
newTaskItem.Flags = updatetask.InventoryData.Flags; newTaskItem.Flags = updatetask.InventoryData.Flags;
//newTaskItem.SaleType=updatetask.InventoryData.SaleType; //newTaskItem.SaleType=updatetask.InventoryData.SaleType;
//newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;; //newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;
newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name); newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name);
newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description); newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description);
newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate; newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate;
@ -11615,6 +11617,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public PacketMethod method; public PacketMethod method;
public bool Async; public bool Async;
} }
public class AsyncPacketProcess public class AsyncPacketProcess
{ {
public bool result = false; public bool result = false;

View File

@ -1160,6 +1160,7 @@ namespace OpenSim.Region.Framework.Scenes
item = LibraryService.LibraryRootFolder.FindItem(itemID); item = LibraryService.LibraryRootFolder.FindItem(itemID);
} }
// If we've found the item in the user's inventory or in the library
if (item != null) if (item != null)
{ {
part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID); part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID);

View File

@ -173,7 +173,9 @@ namespace OpenSim.Region.Framework.Scenes
item.NextPermissions; item.NextPermissions;
taskItem.NextPermissions = item.NextPermissions; taskItem.NextPermissions = item.NextPermissions;
taskItem.CurrentPermissions |= 8; taskItem.CurrentPermissions |= 8;
} else { }
else
{
taskItem.BasePermissions = item.BasePermissions; taskItem.BasePermissions = item.BasePermissions;
taskItem.CurrentPermissions = item.CurrentPermissions; taskItem.CurrentPermissions = item.CurrentPermissions;
taskItem.CurrentPermissions |= 8; taskItem.CurrentPermissions |= 8;

View File

@ -527,6 +527,7 @@ namespace OpenSim.Region.Framework.Scenes
item.ParentID = m_part.UUID; item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID; item.ParentPartID = m_part.UUID;
item.Name = name; item.Name = name;
item.GroupID = m_part.GroupID;
lock (m_items) lock (m_items)
{ {
@ -619,6 +620,12 @@ namespace OpenSim.Region.Framework.Scenes
item.ParentID = m_part.UUID; item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID; item.ParentPartID = m_part.UUID;
item.Flags = m_items[item.ItemID].Flags; item.Flags = m_items[item.ItemID].Flags;
// If group permissions have been set on, check that the groupID is up to date in case it has
// changed since permissions were last set.
if (item.GroupPermissions != (uint)PermissionMask.None)
item.GroupID = m_part.GroupID;
if (item.AssetID == UUID.Zero) if (item.AssetID == UUID.Zero)
{ {
item.AssetID = m_items[item.ItemID].AssetID; item.AssetID = m_items[item.ItemID].AssetID;
@ -770,6 +777,7 @@ namespace OpenSim.Region.Framework.Scenes
uint everyoneMask = 0; uint everyoneMask = 0;
uint baseMask = item.BasePermissions; uint baseMask = item.BasePermissions;
uint ownerMask = item.CurrentPermissions; uint ownerMask = item.CurrentPermissions;
uint groupMask = item.GroupPermissions;
invString.AddItemStart(); invString.AddItemStart();
invString.AddNameValueLine("item_id", item.ItemID.ToString()); invString.AddNameValueLine("item_id", item.ItemID.ToString());
@ -779,7 +787,7 @@ namespace OpenSim.Region.Framework.Scenes
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask)); invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask)); invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(0)); invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask)); invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));