mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
Fix errors introduced by incomplete understanding of what folded perms are
This commit is contained in:
@@ -532,17 +532,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
else
|
||||
{
|
||||
AddPermissions(item, objlist[0], objlist, remoteClient);
|
||||
|
||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||
item.Description = asset.Description;
|
||||
item.Name = asset.Name;
|
||||
item.AssetType = asset.Type;
|
||||
|
||||
//preserve perms on return
|
||||
if(DeRezAction.Return == action)
|
||||
AddPermissions(item, objlist[0], objlist, null);
|
||||
else
|
||||
AddPermissions(item, objlist[0], objlist, remoteClient);
|
||||
|
||||
m_Scene.AddInventoryItem(item);
|
||||
|
||||
if (remoteClient != null && item.Owner == remoteClient.AgentId)
|
||||
@@ -599,15 +595,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
effectivePerms |= (uint)PermissionMask.Move;
|
||||
|
||||
//PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
|
||||
|
||||
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
|
||||
{
|
||||
// Changing ownership, so apply the "Next Owner" permissions to all of the
|
||||
// inventory item's permissions.
|
||||
|
||||
uint perms = effectivePerms;
|
||||
PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms);
|
||||
uint nextPerms = (perms & 7) << 13;
|
||||
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
||||
perms &= ~(uint)PermissionMask.Copy;
|
||||
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
||||
perms &= ~(uint)PermissionMask.Transfer;
|
||||
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
||||
perms &= ~(uint)PermissionMask.Modify;
|
||||
|
||||
item.BasePermissions = perms & so.RootPart.NextOwnerMask;
|
||||
item.CurrentPermissions = item.BasePermissions;
|
||||
@@ -640,10 +640,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
(uint)PermissionMask.Move |
|
||||
(uint)PermissionMask.Export |
|
||||
7); // Preserve folded permissions
|
||||
}
|
||||
|
||||
//PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
|
||||
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user