Perform ownership transfer and permission propagation as well as needed

updates on the new temp attachment.
integration
Melanie 2012-08-14 13:40:13 +01:00
parent 1be072f19e
commit a5b6492223
1 changed files with 28 additions and 0 deletions

View File

@ -120,6 +120,34 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
if (!m_scene.TryGetScenePresence(item.PermsGranter, out target))
return;
if (target.UUID != hostPart.ParentGroup.OwnerID)
{
uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions();
if ((effectivePerms & (uint)PermissionMask.Transfer) == 0)
return;
hostPart.ParentGroup.SetOwnerId(target.UUID);
hostPart.ParentGroup.SetRootPartOwner(hostPart.ParentGroup.RootPart, target.UUID, target.ControllingClient.ActiveGroupId);
if (m_scene.Permissions.PropagatePermissions())
{
foreach (SceneObjectPart child in hostPart.ParentGroup.Parts)
{
child.Inventory.ChangeInventoryOwner(target.UUID);
child.TriggerScriptChangedEvent(Changed.OWNER);
child.ApplyNextOwnerPermissions();
}
}
hostPart.ParentGroup.RootPart.ObjectSaleType = 0;
hostPart.ParentGroup.RootPart.SalePrice = 10;
hostPart.ParentGroup.HasGroupChanged = true;
hostPart.ParentGroup.RootPart.SendPropertiesToClient(target.ControllingClient);
hostPart.ParentGroup.RootPart.ScheduleFullUpdate();
}
attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, true);
}
}