Fix direct item give permissions
parent
f75a3ee762
commit
914e4b319e
|
@ -434,10 +434,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
|
||||
item.GroupPermissions = objectGroup.RootPart.GroupMask & objectGroup.RootPart.NextOwnerMask;
|
||||
|
||||
// Magic number badness. Maybe this deserves an enum.
|
||||
// bit 4 (16) is the "Slam" bit, it means treat as passed
|
||||
// and apply next owner perms on rez
|
||||
item.CurrentPermissions |= 16; // Slam!
|
||||
item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -641,7 +638,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
rootPart.Description = item.Description;
|
||||
|
||||
group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
|
||||
if ((rootPart.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0)
|
||||
if ((rootPart.OwnerID != item.Owner) ||
|
||||
(item.CurrentPermissions & 16) != 0 || // Magic number
|
||||
(item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
|
||||
{
|
||||
//Need to kill the for sale here
|
||||
rootPart.ObjectSaleType = 0;
|
||||
|
@ -651,9 +650,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
{
|
||||
foreach (SceneObjectPart part in group.Parts)
|
||||
{
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
part.GroupMask = 0; // DO NOT propagate here
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
|
||||
part.GroupMask = item.GroupPermissions;
|
||||
}
|
||||
|
||||
group.ApplyNextOwnerPermissions();
|
||||
|
@ -669,8 +671,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
part.Inventory.ChangeInventoryOwner(item.Owner);
|
||||
part.GroupMask = 0; // DO NOT propagate here
|
||||
}
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
|
||||
part.GroupMask = item.GroupPermissions;
|
||||
}
|
||||
|
||||
rootPart.TrimPermissions();
|
||||
|
|
|
@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
|
|||
part.NextOwnerMask;
|
||||
item.GroupPermissions = part.GroupMask &
|
||||
part.NextOwnerMask;
|
||||
item.CurrentPermissions |= 16; // Slam!
|
||||
item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||
|
||||
if (m_scene.AddInventoryItem(item))
|
||||
|
|
|
@ -326,10 +326,17 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
if (UUID.Zero == transactionID)
|
||||
{
|
||||
item.Flags = itemUpd.Flags;
|
||||
item.Name = itemUpd.Name;
|
||||
item.Description = itemUpd.Description;
|
||||
if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions))
|
||||
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
|
||||
item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
|
||||
if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions))
|
||||
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
|
||||
item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions;
|
||||
if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions))
|
||||
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
|
||||
item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions;
|
||||
item.GroupID = itemUpd.GroupID;
|
||||
item.GroupOwned = itemUpd.GroupOwned;
|
||||
|
@ -344,9 +351,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// TODO: Check if folder changed and move item
|
||||
//item.NextPermissions = itemUpd.Folder;
|
||||
item.InvType = itemUpd.InvType;
|
||||
|
||||
if (item.SalePrice != itemUpd.SalePrice ||
|
||||
item.SaleType != itemUpd.SaleType)
|
||||
item.Flags |= (uint)InventoryItemFlags.ObjectSlamSale;
|
||||
item.SalePrice = itemUpd.SalePrice;
|
||||
item.SaleType = itemUpd.SaleType;
|
||||
item.Flags = itemUpd.Flags;
|
||||
|
||||
InventoryService.UpdateItem(item);
|
||||
}
|
||||
|
@ -527,7 +537,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// Assign to the actual item. Make sure the slam bit is
|
||||
// set, if it wasn't set before.
|
||||
itemCopy.BasePermissions = basePerms;
|
||||
itemCopy.CurrentPermissions = ownerPerms | 16; // Slam
|
||||
itemCopy.CurrentPermissions = ownerPerms;
|
||||
itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
||||
|
||||
itemCopy.NextPermissions = item.NextPermissions;
|
||||
|
||||
|
@ -1043,7 +1054,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
else
|
||||
agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
|
||||
|
||||
agentItem.CurrentPermissions |= 16; // Slam
|
||||
agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
||||
agentItem.NextPermissions = taskItem.NextPermissions;
|
||||
agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
|
||||
agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
|
||||
|
@ -1254,7 +1265,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
(srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
|
||||
destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
|
||||
(srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
|
||||
destTaskItem.CurrentPermissions |= 16; // Slam!
|
||||
destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1435,6 +1446,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// Base ALWAYS has move
|
||||
currentItem.BasePermissions |= (uint)PermissionMask.Move;
|
||||
|
||||
itemInfo.Flags = currentItem.Flags;
|
||||
|
||||
// Check if we're allowed to mess with permissions
|
||||
if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god
|
||||
{
|
||||
|
@ -1452,6 +1465,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// Owner can't change base, and can change other
|
||||
// only up to base
|
||||
itemInfo.BasePermissions = currentItem.BasePermissions;
|
||||
if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions)
|
||||
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
|
||||
if (itemInfo.GroupPermissions != currentItem.GroupPermissions)
|
||||
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
|
||||
if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions)
|
||||
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner;
|
||||
if (itemInfo.NextPermissions != currentItem.NextPermissions)
|
||||
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
|
||||
itemInfo.EveryonePermissions &= currentItem.BasePermissions;
|
||||
itemInfo.GroupPermissions &= currentItem.BasePermissions;
|
||||
itemInfo.CurrentPermissions &= currentItem.BasePermissions;
|
||||
|
@ -1459,6 +1480,19 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (itemInfo.BasePermissions != currentItem.BasePermissions)
|
||||
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteBase;
|
||||
if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions)
|
||||
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
|
||||
if (itemInfo.GroupPermissions != currentItem.GroupPermissions)
|
||||
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
|
||||
if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions)
|
||||
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner;
|
||||
if (itemInfo.NextPermissions != currentItem.NextPermissions)
|
||||
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
|
||||
}
|
||||
|
||||
// Next ALWAYS has move
|
||||
itemInfo.NextPermissions |= (uint)PermissionMask.Move;
|
||||
|
@ -1667,7 +1701,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
srcTaskItem.NextPermissions;
|
||||
destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
|
||||
srcTaskItem.NextPermissions;
|
||||
destTaskItem.CurrentPermissions |= 16; // Slam!
|
||||
destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
taskItem.NextPermissions = item.NextPermissions;
|
||||
// We're adding this to a prim we don't own. Force
|
||||
// owner change
|
||||
taskItem.CurrentPermissions |= 16; // Slam
|
||||
taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -629,14 +629,19 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
group.SetGroup(m_part.GroupID, null);
|
||||
|
||||
if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0)
|
||||
// TODO: Remove magic number badness
|
||||
if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
|
||||
{
|
||||
if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions())
|
||||
{
|
||||
foreach (SceneObjectPart part in partList)
|
||||
{
|
||||
part.EveryoneMask = item.EveryonePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
|
||||
part.EveryoneMask = item.EveryonePermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
|
||||
part.GroupMask = item.GroupPermissions;
|
||||
}
|
||||
|
||||
group.ApplyNextOwnerPermissions();
|
||||
|
@ -645,15 +650,20 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
foreach (SceneObjectPart part in partList)
|
||||
{
|
||||
if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0)
|
||||
// TODO: Remove magic number badness
|
||||
if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
|
||||
{
|
||||
part.LastOwnerID = part.OwnerID;
|
||||
part.OwnerID = item.OwnerID;
|
||||
part.Inventory.ChangeInventoryOwner(item.OwnerID);
|
||||
}
|
||||
|
||||
part.EveryoneMask = item.EveryonePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
|
||||
part.EveryoneMask = item.EveryonePermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
|
||||
part.GroupMask = item.GroupPermissions;
|
||||
}
|
||||
|
||||
rootPart.TrimPermissions();
|
||||
|
|
Loading…
Reference in New Issue