diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 4f2b446..f556b35 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -438,29 +438,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
438 | itemCopy.InvType = item.InvType; | 438 | itemCopy.InvType = item.InvType; |
439 | itemCopy.Folder = recipientFolderId; | 439 | itemCopy.Folder = recipientFolderId; |
440 | 440 | ||
441 | if (Permissions.PropagatePermissions()) | 441 | if (Permissions.PropagatePermissions() && recipient != senderId) |
442 | { | 442 | { |
443 | // First, make sore base is limited to the next perms | ||
444 | itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; | ||
445 | // By default, current equals base | ||
446 | itemCopy.CurrentPermissions = itemCopy.BasePermissions; | ||
447 | |||
448 | // If this is an object, replace current perms | ||
449 | // with folded perms | ||
443 | if (item.InvType == (int)InventoryType.Object) | 450 | if (item.InvType == (int)InventoryType.Object) |
444 | { | 451 | { |
445 | itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); | 452 | itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); |
446 | itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; | 453 | itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13; |
447 | } | ||
448 | else | ||
449 | { | ||
450 | itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; | ||
451 | } | 454 | } |
452 | 455 | ||
453 | itemCopy.CurrentPermissions = itemCopy.BasePermissions; | 456 | // Ensure there is no escalation |
454 | if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit | 457 | itemCopy.CurrentPermissions &= item.NextPermissions; |
455 | { | 458 | |
456 | itemCopy.BasePermissions &= item.NextPermissions; | 459 | // Need slam bit on xfer |
457 | itemCopy.CurrentPermissions = itemCopy.BasePermissions; | 460 | itemCopy.CurrentPermissions |= 8; |
458 | itemCopy.CurrentPermissions |= 8; | ||
459 | } | ||
460 | 461 | ||
461 | itemCopy.NextPermissions = item.NextPermissions; | 462 | itemCopy.NextPermissions = item.NextPermissions; |
462 | itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; | 463 | |
463 | itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; | 464 | itemCopy.EveryOnePermissions = 0; |
465 | itemCopy.GroupPermissions = 0; | ||
464 | } | 466 | } |
465 | else | 467 | else |
466 | { | 468 | { |
@@ -531,7 +533,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
531 | return null; | 533 | return null; |
532 | } | 534 | } |
533 | 535 | ||
534 | |||
535 | if (recipientParentFolderId == UUID.Zero) | 536 | if (recipientParentFolderId == UUID.Zero) |
536 | { | 537 | { |
537 | InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId); | 538 | InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId); |
@@ -910,12 +911,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
910 | 911 | ||
911 | if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) | 912 | if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) |
912 | { | 913 | { |
914 | agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions; | ||
913 | if (taskItem.InvType == (int)InventoryType.Object) | 915 | if (taskItem.InvType == (int)InventoryType.Object) |
914 | agentItem.BasePermissions = taskItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); | 916 | agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); |
915 | else | 917 | agentItem.CurrentPermissions = agentItem.BasePermissions ; |
916 | agentItem.BasePermissions = taskItem.BasePermissions; | 918 | |
917 | agentItem.BasePermissions &= taskItem.NextPermissions; | 919 | agentItem.CurrentPermissions |= 8; |
918 | agentItem.CurrentPermissions = agentItem.BasePermissions | 8; | ||
919 | agentItem.NextPermissions = taskItem.NextPermissions; | 920 | agentItem.NextPermissions = taskItem.NextPermissions; |
920 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; | 921 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; |
921 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; | 922 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; |
@@ -2075,7 +2076,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2075 | group.RootPart.IsAttachment = true; | 2076 | group.RootPart.IsAttachment = true; |
2076 | } | 2077 | } |
2077 | 2078 | ||
2078 | AddNewSceneObject(group, true); | 2079 | // If we're rezzing an attachment then don't ask AddNewSceneObject() to update the client since |
2080 | // we'll be doing that later on. Scheduling more than one full update during the attachment | ||
2081 | // process causes some clients to fail to display the attachment properly. | ||
2082 | AddNewSceneObject(group, true, !attachment); | ||
2079 | 2083 | ||
2080 | // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); | 2084 | // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); |
2081 | // if attachment we set it's asset id so object updates can reflect that | 2085 | // if attachment we set it's asset id so object updates can reflect that |
@@ -2445,6 +2449,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2445 | return; | 2449 | return; |
2446 | } | 2450 | } |
2447 | 2451 | ||
2452 | m_log.DebugFormat("[SCENE INVENTORY]: {0} {1} IsAttachment={2}", att.Name, att.LocalId, att.IsAttachment); | ||
2453 | Console.WriteLine("HERE X"); | ||
2448 | ScenePresence presence; | 2454 | ScenePresence presence; |
2449 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2455 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2450 | { | 2456 | { |
@@ -2452,9 +2458,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2452 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 2458 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2453 | item = InventoryService.GetItem(item); | 2459 | item = InventoryService.GetItem(item); |
2454 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 2460 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
2461 | Console.WriteLine("HERE Y"); | ||
2455 | 2462 | ||
2456 | if (m_AvatarFactory != null) | 2463 | if (m_AvatarFactory != null) |
2457 | m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 2464 | m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); |
2465 | |||
2466 | Console.WriteLine("HERE Z"); | ||
2458 | } | 2467 | } |
2459 | } | 2468 | } |
2460 | 2469 | ||
@@ -2637,4 +2646,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
2637 | m_sceneGraph.LinkObjects(root, children); | 2646 | m_sceneGraph.LinkObjects(root, children); |
2638 | } | 2647 | } |
2639 | } | 2648 | } |
2640 | } | 2649 | } \ No newline at end of file |