diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 2057c65..1a7da61 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -381,12 +381,27 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
381 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) | 381 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) |
382 | perms &= ~(uint)PermissionMask.Modify; | 382 | perms &= ~(uint)PermissionMask.Modify; |
383 | 383 | ||
384 | // Make sure all bits but the ones we want are clear | ||
385 | // on take. | ||
386 | // This will be applied to the current perms, so | ||
387 | // it will do what we want. | ||
388 | objectGroup.RootPart.NextOwnerMask &= | ||
389 | ((uint)PermissionMask.Copy | | ||
390 | (uint)PermissionMask.Transfer | | ||
391 | (uint)PermissionMask.Modify); | ||
392 | objectGroup.RootPart.NextOwnerMask |= | ||
393 | (uint)PermissionMask.Move; | ||
394 | |||
384 | item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask; | 395 | item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask; |
385 | item.CurrentPermissions = item.BasePermissions; | 396 | item.CurrentPermissions = item.BasePermissions; |
386 | item.NextPermissions = objectGroup.RootPart.NextOwnerMask; | 397 | item.NextPermissions = objectGroup.RootPart.NextOwnerMask; |
387 | item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; | 398 | item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; |
388 | item.GroupPermissions = objectGroup.RootPart.GroupMask & objectGroup.RootPart.NextOwnerMask; | 399 | item.GroupPermissions = objectGroup.RootPart.GroupMask & objectGroup.RootPart.NextOwnerMask; |
389 | item.CurrentPermissions |= 8; // Slam! | 400 | |
401 | // Magic number badness. Maybe this deserves an enum. | ||
402 | // bit 4 (16) is the "Slam" bit, it means treat as passed | ||
403 | // and apply next owner perms on rez | ||
404 | item.CurrentPermissions |= 16; // Slam! | ||
390 | } | 405 | } |
391 | else | 406 | else |
392 | { | 407 | { |
@@ -396,7 +411,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
396 | item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; | 411 | item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; |
397 | item.GroupPermissions = objectGroup.RootPart.GroupMask; | 412 | item.GroupPermissions = objectGroup.RootPart.GroupMask; |
398 | 413 | ||
399 | item.CurrentPermissions |= 8; // Slam! | 414 | item.CurrentPermissions &= |
415 | ((uint)PermissionMask.Copy | | ||
416 | (uint)PermissionMask.Transfer | | ||
417 | (uint)PermissionMask.Modify | | ||
418 | (uint)PermissionMask.Move | | ||
419 | 7); // Preserve folded permissions | ||
400 | } | 420 | } |
401 | 421 | ||
402 | // TODO: add the new fields (Flags, Sale info, etc) | 422 | // TODO: add the new fields (Flags, Sale info, etc) |
@@ -499,6 +519,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
499 | 519 | ||
500 | group.RootPart.FromFolderID = item.Folder; | 520 | group.RootPart.FromFolderID = item.Folder; |
501 | 521 | ||
522 | // If it's rezzed in world, select it. Much easier to | ||
523 | // find small items. | ||
524 | // | ||
525 | if (!attachment) | ||
526 | group.RootPart.CreateSelected = true; | ||
527 | |||
502 | if (!m_Scene.Permissions.CanRezObject( | 528 | if (!m_Scene.Permissions.CanRezObject( |
503 | group.Children.Count, remoteClient.AgentId, pos) | 529 | group.Children.Count, remoteClient.AgentId, pos) |
504 | && !attachment) | 530 | && !attachment) |
@@ -571,7 +597,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
571 | List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); | 597 | List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); |
572 | 598 | ||
573 | group.SetGroup(remoteClient.ActiveGroupId, remoteClient); | 599 | group.SetGroup(remoteClient.ActiveGroupId, remoteClient); |
574 | if (rootPart.OwnerID != item.Owner) | 600 | if ((rootPart.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0) |
575 | { | 601 | { |
576 | //Need to kill the for sale here | 602 | //Need to kill the for sale here |
577 | rootPart.ObjectSaleType = 0; | 603 | rootPart.ObjectSaleType = 0; |
@@ -579,14 +605,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
579 | 605 | ||
580 | if (m_Scene.Permissions.PropagatePermissions()) | 606 | if (m_Scene.Permissions.PropagatePermissions()) |
581 | { | 607 | { |
582 | if ((item.CurrentPermissions & 8) != 0) | 608 | foreach (SceneObjectPart part in partList) |
583 | { | 609 | { |
584 | foreach (SceneObjectPart part in partList) | 610 | part.EveryoneMask = item.EveryOnePermissions; |
585 | { | 611 | part.NextOwnerMask = item.NextPermissions; |
586 | part.EveryoneMask = item.EveryOnePermissions; | 612 | part.GroupMask = 0; // DO NOT propagate here |
587 | part.NextOwnerMask = item.NextPermissions; | ||
588 | part.GroupMask = 0; // DO NOT propagate here | ||
589 | } | ||
590 | } | 613 | } |
591 | 614 | ||
592 | group.ApplyNextOwnerPermissions(); | 615 | group.ApplyNextOwnerPermissions(); |
@@ -595,19 +618,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
595 | 618 | ||
596 | foreach (SceneObjectPart part in partList) | 619 | foreach (SceneObjectPart part in partList) |
597 | { | 620 | { |
598 | if (part.OwnerID != item.Owner) | 621 | if ((part.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0) |
599 | { | 622 | { |
600 | part.LastOwnerID = part.OwnerID; | 623 | part.LastOwnerID = part.OwnerID; |
601 | part.OwnerID = item.Owner; | 624 | part.OwnerID = item.Owner; |
602 | part.Inventory.ChangeInventoryOwner(item.Owner); | 625 | part.Inventory.ChangeInventoryOwner(item.Owner); |
603 | } | ||
604 | else if (((item.CurrentPermissions & 8) != 0) && (!attachment)) // Slam! | ||
605 | { | ||
606 | part.EveryoneMask = item.EveryOnePermissions; | ||
607 | part.NextOwnerMask = item.NextPermissions; | ||
608 | |||
609 | part.GroupMask = 0; // DO NOT propagate here | 626 | part.GroupMask = 0; // DO NOT propagate here |
610 | } | 627 | } |
628 | part.EveryoneMask = item.EveryOnePermissions; | ||
629 | part.NextOwnerMask = item.NextPermissions; | ||
611 | } | 630 | } |
612 | 631 | ||
613 | rootPart.TrimPermissions(); | 632 | rootPart.TrimPermissions(); |