Fix a perms issue when wearing an object from inworld

avinationmerge
Melanie 2010-12-12 21:24:00 +01:00
parent 663a626a6f
commit 63353a0687
1 changed files with 18 additions and 10 deletions

View File

@ -1902,21 +1902,29 @@ namespace OpenSim.Region.Framework.Scenes
else // oopsies else // oopsies
item.Folder = UUID.Zero; item.Folder = UUID.Zero;
// Set up base perms properly
uint permsBase = (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify);
permsBase &= grp.RootPart.BaseMask;
permsBase |= (uint)PermissionMask.Move;
// Make sure we don't lock it
grp.RootPart.NextOwnerMask |= (uint)PermissionMask.Move;
if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions()) if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions())
{ {
item.BasePermissions = grp.RootPart.NextOwnerMask; item.BasePermissions = permsBase & grp.RootPart.NextOwnerMask;
item.CurrentPermissions = grp.RootPart.NextOwnerMask; item.CurrentPermissions = permsBase & grp.RootPart.NextOwnerMask;
item.NextPermissions = grp.RootPart.NextOwnerMask; item.NextPermissions = permsBase & grp.RootPart.NextOwnerMask;
item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask; item.EveryOnePermissions = permsBase & grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask;
item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask; item.GroupPermissions = permsBase & grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask;
} }
else else
{ {
item.BasePermissions = grp.RootPart.BaseMask; item.BasePermissions = permsBase;
item.CurrentPermissions = grp.RootPart.OwnerMask; item.CurrentPermissions = permsBase & grp.RootPart.OwnerMask;
item.NextPermissions = grp.RootPart.NextOwnerMask; item.NextPermissions = permsBase & grp.RootPart.NextOwnerMask;
item.EveryOnePermissions = grp.RootPart.EveryoneMask; item.EveryOnePermissions = permsBase & grp.RootPart.EveryoneMask;
item.GroupPermissions = grp.RootPart.GroupMask; item.GroupPermissions = permsBase & grp.RootPart.GroupMask;
} }
item.CreationDate = Util.UnixTimeSinceEpoch(); item.CreationDate = Util.UnixTimeSinceEpoch();