Fix the long-standing bug that object permissions set in inventory were lost
NOTE: Items rezzed by users using 0.8 or older will still exhibit broken behaviour. Until 0.8 becomes end of life, this fix will not produce dependable results on grids with mixed versions. Grids based on 0.9 will now work properly.melanie
parent
da76224eac
commit
e526e8c5e2
|
@ -1141,6 +1141,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
part.OwnerID = item.Owner;
|
part.OwnerID = item.Owner;
|
||||||
part.RezzerID = item.Owner;
|
part.RezzerID = item.Owner;
|
||||||
part.Inventory.ChangeInventoryOwner(item.Owner);
|
part.Inventory.ChangeInventoryOwner(item.Owner);
|
||||||
|
|
||||||
|
// This applies the base mask from the item as the next
|
||||||
|
// permissions for the object. This is correct because the
|
||||||
|
// giver's base mask was masked by the giver's next owner
|
||||||
|
// mask, so the base mask equals the original next owner mask.
|
||||||
|
part.NextOwnerMask = item.BasePermissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
so.ApplyNextOwnerPermissions();
|
so.ApplyNextOwnerPermissions();
|
||||||
|
@ -1152,10 +1158,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
{
|
{
|
||||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
|
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
|
||||||
{
|
{
|
||||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
|
part.EveryoneMask = item.EveryOnePermissions & part.BaseMask;
|
||||||
part.EveryoneMask = item.EveryOnePermissions & part.BaseMask;
|
part.NextOwnerMask = item.NextPermissions & part.BaseMask;
|
||||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
|
|
||||||
part.NextOwnerMask = item.NextPermissions & part.BaseMask;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -627,6 +627,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
itemCopy.AssetType = item.AssetType;
|
itemCopy.AssetType = item.AssetType;
|
||||||
itemCopy.InvType = item.InvType;
|
itemCopy.InvType = item.InvType;
|
||||||
itemCopy.Folder = recipientFolderId;
|
itemCopy.Folder = recipientFolderId;
|
||||||
|
itemCopy.Flags = item.Flags;
|
||||||
|
|
||||||
if (Permissions.PropagatePermissions() && recipient != senderId)
|
if (Permissions.PropagatePermissions() && recipient != senderId)
|
||||||
{
|
{
|
||||||
|
@ -643,7 +644,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//
|
//
|
||||||
// Transfer
|
// Transfer
|
||||||
// Copy
|
// Copy
|
||||||
// Modufy
|
// Modify
|
||||||
uint permsMask = ~ ((uint)PermissionMask.Copy |
|
uint permsMask = ~ ((uint)PermissionMask.Copy |
|
||||||
(uint)PermissionMask.Transfer |
|
(uint)PermissionMask.Transfer |
|
||||||
(uint)PermissionMask.Modify);
|
(uint)PermissionMask.Modify);
|
||||||
|
@ -718,6 +719,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
itemCopy.BasePermissions = basePerms;
|
itemCopy.BasePermissions = basePerms;
|
||||||
itemCopy.CurrentPermissions = ownerPerms;
|
itemCopy.CurrentPermissions = ownerPerms;
|
||||||
itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
||||||
|
// Need to clear the other inventory slam options.
|
||||||
|
// That is so we can handle the case where the recipient
|
||||||
|
// changes the bits in inventory before rezzing
|
||||||
|
itemCopy.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
|
||||||
|
|
||||||
itemCopy.NextPermissions = item.NextPermissions;
|
itemCopy.NextPermissions = item.NextPermissions;
|
||||||
|
|
||||||
|
@ -767,9 +772,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
itemCopy.GroupID = UUID.Zero;
|
itemCopy.GroupID = UUID.Zero;
|
||||||
itemCopy.GroupOwned = false;
|
itemCopy.GroupOwned = false;
|
||||||
itemCopy.Flags = item.Flags;
|
itemCopy.SalePrice = 0; //item.SalePrice;
|
||||||
itemCopy.SalePrice = item.SalePrice;
|
itemCopy.SaleType = 0; //item.SaleType;
|
||||||
itemCopy.SaleType = item.SaleType;
|
|
||||||
|
|
||||||
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
|
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
|
||||||
if (invAccess != null)
|
if (invAccess != null)
|
||||||
|
@ -1251,9 +1255,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
agentItem.CurrentPermissions = agentItem.BasePermissions;
|
agentItem.CurrentPermissions = agentItem.BasePermissions;
|
||||||
|
|
||||||
agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
||||||
|
agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
|
||||||
agentItem.NextPermissions = taskItem.NextPermissions;
|
agentItem.NextPermissions = taskItem.NextPermissions;
|
||||||
agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
|
agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
|
||||||
agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
|
// Group permissions make no sense here
|
||||||
|
agentItem.GroupPermissions = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1261,7 +1267,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
agentItem.CurrentPermissions = taskItem.CurrentPermissions;
|
agentItem.CurrentPermissions = taskItem.CurrentPermissions;
|
||||||
agentItem.NextPermissions = taskItem.NextPermissions;
|
agentItem.NextPermissions = taskItem.NextPermissions;
|
||||||
agentItem.EveryOnePermissions = taskItem.EveryonePermissions;
|
agentItem.EveryOnePermissions = taskItem.EveryonePermissions;
|
||||||
agentItem.GroupPermissions = taskItem.GroupPermissions;
|
agentItem.GroupPermissions = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
message = null;
|
message = null;
|
||||||
|
|
|
@ -5242,6 +5242,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
||||||
BaseMask &= NextOwnerMask | (uint)PermissionMask.Export;
|
BaseMask &= NextOwnerMask | (uint)PermissionMask.Export;
|
||||||
OwnerMask &= NextOwnerMask;
|
OwnerMask &= NextOwnerMask;
|
||||||
EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export;
|
EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export;
|
||||||
|
GroupMask = 0; // Giving an object zaps group permissions
|
||||||
|
|
||||||
Inventory.ApplyNextOwnerPermissions();
|
Inventory.ApplyNextOwnerPermissions();
|
||||||
}
|
}
|
||||||
|
|
|
@ -947,7 +947,6 @@ namespace OpenSim.Services.UserAccountService
|
||||||
if (item.InvType == (int)InventoryType.Object)
|
if (item.InvType == (int)InventoryType.Object)
|
||||||
{
|
{
|
||||||
uint perms = item.CurrentPermissions;
|
uint perms = item.CurrentPermissions;
|
||||||
PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref perms);
|
|
||||||
item.CurrentPermissions = perms;
|
item.CurrentPermissions = perms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue