aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs35
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs43
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs22
5 files changed, 79 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 623cd3a..0163060 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -511,10 +511,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
511 item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask; 511 item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask;
512 item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask; 512 item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask;
513 513
514 // Magic number badness. Maybe this deserves an enum. 514 item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
515 // bit 4 (16) is the "Slam" bit, it means treat as passed
516 // and apply next owner perms on rez
517 item.CurrentPermissions |= 16; // Slam!
518 } 515 }
519 else 516 else
520 { 517 {
@@ -789,13 +786,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
789 { 786 {
790 rootPart.Name = item.Name; 787 rootPart.Name = item.Name;
791 rootPart.Description = item.Description; 788 rootPart.Description = item.Description;
789 }
790 if ((item.Flags & (uint)InventoryItemFlags.ObjectSlamSale) != 0)
791 {
792 rootPart.ObjectSaleType = item.SaleType; 792 rootPart.ObjectSaleType = item.SaleType;
793 rootPart.SalePrice = item.SalePrice; 793 rootPart.SalePrice = item.SalePrice;
794 } 794 }
795 795
796 group.SetGroup(remoteClient.ActiveGroupId, remoteClient); 796 group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
797 // TODO: Remove the magic number badness
798
797 if ((rootPart.OwnerID != item.Owner) || 799 if ((rootPart.OwnerID != item.Owner) ||
798 (item.CurrentPermissions & 16) != 0) 800 (item.CurrentPermissions & 16) != 0 || // Magic number
801 (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
799 { 802 {
800 //Need to kill the for sale here 803 //Need to kill the for sale here
801 rootPart.ObjectSaleType = 0; 804 rootPart.ObjectSaleType = 0;
@@ -807,10 +810,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
807 { 810 {
808 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) 811 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
809 { 812 {
810 part.EveryoneMask = item.EveryOnePermissions; 813 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
811 part.NextOwnerMask = item.NextPermissions; 814 part.EveryoneMask = item.EveryOnePermissions;
815 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
816 part.NextOwnerMask = item.NextPermissions;
817 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
818 part.GroupMask = item.GroupPermissions;
812 } 819 }
813 part.GroupMask = 0; // DO NOT propagate here
814 } 820 }
815 821
816 group.ApplyNextOwnerPermissions(); 822 group.ApplyNextOwnerPermissions();
@@ -819,16 +825,21 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
819 825
820 foreach (SceneObjectPart part in group.Parts) 826 foreach (SceneObjectPart part in group.Parts)
821 { 827 {
828 // TODO: Remove the magic number badness
822 if ((part.OwnerID != item.Owner) || 829 if ((part.OwnerID != item.Owner) ||
823 (item.CurrentPermissions & 16) != 0) 830 (item.CurrentPermissions & 16) != 0 || // Magic number
831 (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
824 { 832 {
825 part.LastOwnerID = part.OwnerID; 833 part.LastOwnerID = part.OwnerID;
826 part.OwnerID = item.Owner; 834 part.OwnerID = item.Owner;
827 part.Inventory.ChangeInventoryOwner(item.Owner); 835 part.Inventory.ChangeInventoryOwner(item.Owner);
828 part.GroupMask = 0; // DO NOT propagate here
829 } 836 }
830 part.EveryoneMask = item.EveryOnePermissions; 837 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
831 part.NextOwnerMask = item.NextPermissions; 838 part.EveryoneMask = item.EveryOnePermissions;
839 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
840 part.NextOwnerMask = item.NextPermissions;
841 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
842 part.GroupMask = item.GroupPermissions;
832 } 843 }
833 844
834 rootPart.TrimPermissions(); 845 rootPart.TrimPermissions();
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index 568ba19..be399ff 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
215 part.NextOwnerMask; 215 part.NextOwnerMask;
216 item.GroupPermissions = part.GroupMask & 216 item.GroupPermissions = part.GroupMask &
217 part.NextOwnerMask; 217 part.NextOwnerMask;
218 item.CurrentPermissions |= 16; // Slam! 218 item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
219 item.CreationDate = Util.UnixTimeSinceEpoch(); 219 item.CreationDate = Util.UnixTimeSinceEpoch();
220 220
221 if (m_scene.AddInventoryItem(item)) 221 if (m_scene.AddInventoryItem(item))
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 1f32362..7fa5509 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -310,8 +310,14 @@ namespace OpenSim.Region.Framework.Scenes
310 { 310 {
311 item.Name = itemUpd.Name; 311 item.Name = itemUpd.Name;
312 item.Description = itemUpd.Description; 312 item.Description = itemUpd.Description;
313 if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions))
314 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
313 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; 315 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
316 if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions))
317 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
314 item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; 318 item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions;
319 if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions))
320 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
315 item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; 321 item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions;
316 item.GroupID = itemUpd.GroupID; 322 item.GroupID = itemUpd.GroupID;
317 item.GroupOwned = itemUpd.GroupOwned; 323 item.GroupOwned = itemUpd.GroupOwned;
@@ -326,9 +332,12 @@ namespace OpenSim.Region.Framework.Scenes
326 // TODO: Check if folder changed and move item 332 // TODO: Check if folder changed and move item
327 //item.NextPermissions = itemUpd.Folder; 333 //item.NextPermissions = itemUpd.Folder;
328 item.InvType = itemUpd.InvType; 334 item.InvType = itemUpd.InvType;
335
336 if (item.SalePrice != itemUpd.SalePrice ||
337 item.SaleType != itemUpd.SaleType)
338 item.Flags |= (uint)InventoryItemFlags.ObjectSlamSale;
329 item.SalePrice = itemUpd.SalePrice; 339 item.SalePrice = itemUpd.SalePrice;
330 item.SaleType = itemUpd.SaleType; 340 item.SaleType = itemUpd.SaleType;
331 item.Flags = itemUpd.Flags;
332 341
333 InventoryService.UpdateItem(item); 342 InventoryService.UpdateItem(item);
334 } 343 }
@@ -509,7 +518,8 @@ namespace OpenSim.Region.Framework.Scenes
509 // Assign to the actual item. Make sure the slam bit is 518 // Assign to the actual item. Make sure the slam bit is
510 // set, if it wasn't set before. 519 // set, if it wasn't set before.
511 itemCopy.BasePermissions = basePerms; 520 itemCopy.BasePermissions = basePerms;
512 itemCopy.CurrentPermissions = ownerPerms | 16; // Slam 521 itemCopy.CurrentPermissions = ownerPerms;
522 itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
513 523
514 itemCopy.NextPermissions = item.NextPermissions; 524 itemCopy.NextPermissions = item.NextPermissions;
515 525
@@ -1049,7 +1059,7 @@ namespace OpenSim.Region.Framework.Scenes
1049 else 1059 else
1050 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; 1060 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
1051 1061
1052 agentItem.CurrentPermissions |= 16; // Slam 1062 agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
1053 agentItem.NextPermissions = taskItem.NextPermissions; 1063 agentItem.NextPermissions = taskItem.NextPermissions;
1054 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); 1064 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
1055 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; 1065 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
@@ -1260,7 +1270,7 @@ namespace OpenSim.Region.Framework.Scenes
1260 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); 1270 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1261 destTaskItem.BasePermissions = srcTaskItem.BasePermissions & 1271 destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
1262 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); 1272 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1263 destTaskItem.CurrentPermissions |= 16; // Slam! 1273 destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
1264 } 1274 }
1265 } 1275 }
1266 1276
@@ -1434,6 +1444,8 @@ namespace OpenSim.Region.Framework.Scenes
1434 // Base ALWAYS has move 1444 // Base ALWAYS has move
1435 currentItem.BasePermissions |= (uint)PermissionMask.Move; 1445 currentItem.BasePermissions |= (uint)PermissionMask.Move;
1436 1446
1447 itemInfo.Flags = currentItem.Flags;
1448
1437 // Check if we're allowed to mess with permissions 1449 // Check if we're allowed to mess with permissions
1438 if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god 1450 if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god
1439 { 1451 {
@@ -1451,6 +1463,14 @@ namespace OpenSim.Region.Framework.Scenes
1451 // Owner can't change base, and can change other 1463 // Owner can't change base, and can change other
1452 // only up to base 1464 // only up to base
1453 itemInfo.BasePermissions = currentItem.BasePermissions; 1465 itemInfo.BasePermissions = currentItem.BasePermissions;
1466 if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions)
1467 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
1468 if (itemInfo.GroupPermissions != currentItem.GroupPermissions)
1469 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
1470 if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions)
1471 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner;
1472 if (itemInfo.NextPermissions != currentItem.NextPermissions)
1473 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
1454 itemInfo.EveryonePermissions &= currentItem.BasePermissions; 1474 itemInfo.EveryonePermissions &= currentItem.BasePermissions;
1455 itemInfo.GroupPermissions &= currentItem.BasePermissions; 1475 itemInfo.GroupPermissions &= currentItem.BasePermissions;
1456 itemInfo.CurrentPermissions &= currentItem.BasePermissions; 1476 itemInfo.CurrentPermissions &= currentItem.BasePermissions;
@@ -1458,6 +1478,19 @@ namespace OpenSim.Region.Framework.Scenes
1458 } 1478 }
1459 1479
1460 } 1480 }
1481 else
1482 {
1483 if (itemInfo.BasePermissions != currentItem.BasePermissions)
1484 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteBase;
1485 if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions)
1486 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
1487 if (itemInfo.GroupPermissions != currentItem.GroupPermissions)
1488 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
1489 if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions)
1490 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner;
1491 if (itemInfo.NextPermissions != currentItem.NextPermissions)
1492 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
1493 }
1461 1494
1462 // Next ALWAYS has move 1495 // Next ALWAYS has move
1463 itemInfo.NextPermissions |= (uint)PermissionMask.Move; 1496 itemInfo.NextPermissions |= (uint)PermissionMask.Move;
@@ -1666,7 +1699,7 @@ namespace OpenSim.Region.Framework.Scenes
1666 srcTaskItem.NextPermissions; 1699 srcTaskItem.NextPermissions;
1667 destTaskItem.BasePermissions = srcTaskItem.BasePermissions & 1700 destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
1668 srcTaskItem.NextPermissions; 1701 srcTaskItem.NextPermissions;
1669 destTaskItem.CurrentPermissions |= 16; // Slam! 1702 destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
1670 } 1703 }
1671 } 1704 }
1672 1705
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 50521c4..0b545c4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes
118 taskItem.NextPermissions = item.NextPermissions; 118 taskItem.NextPermissions = item.NextPermissions;
119 // We're adding this to a prim we don't own. Force 119 // We're adding this to a prim we don't own. Force
120 // owner change 120 // owner change
121 taskItem.CurrentPermissions |= 16; // Slam 121 taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
122 } 122 }
123 else 123 else
124 { 124 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 3b1ab01..8761284 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -815,14 +815,19 @@ namespace OpenSim.Region.Framework.Scenes
815 815
816 group.SetGroup(m_part.GroupID, null); 816 group.SetGroup(m_part.GroupID, null);
817 817
818 if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) 818 // TODO: Remove magic number badness
819 if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
819 { 820 {
820 if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) 821 if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions())
821 { 822 {
822 foreach (SceneObjectPart part in partList) 823 foreach (SceneObjectPart part in partList)
823 { 824 {
824 part.EveryoneMask = item.EveryonePermissions; 825 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
825 part.NextOwnerMask = item.NextPermissions; 826 part.EveryoneMask = item.EveryonePermissions;
827 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
828 part.NextOwnerMask = item.NextPermissions;
829 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
830 part.GroupMask = item.GroupPermissions;
826 } 831 }
827 832
828 group.ApplyNextOwnerPermissions(); 833 group.ApplyNextOwnerPermissions();
@@ -831,15 +836,20 @@ namespace OpenSim.Region.Framework.Scenes
831 836
832 foreach (SceneObjectPart part in partList) 837 foreach (SceneObjectPart part in partList)
833 { 838 {
834 if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) 839 // TODO: Remove magic number badness
840 if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
835 { 841 {
836 part.LastOwnerID = part.OwnerID; 842 part.LastOwnerID = part.OwnerID;
837 part.OwnerID = item.OwnerID; 843 part.OwnerID = item.OwnerID;
838 part.Inventory.ChangeInventoryOwner(item.OwnerID); 844 part.Inventory.ChangeInventoryOwner(item.OwnerID);
839 } 845 }
840 846
841 part.EveryoneMask = item.EveryonePermissions; 847 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
842 part.NextOwnerMask = item.NextPermissions; 848 part.EveryoneMask = item.EveryonePermissions;
849 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
850 part.NextOwnerMask = item.NextPermissions;
851 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
852 part.GroupMask = item.GroupPermissions;
843 } 853 }
844 854
845 rootPart.TrimPermissions(); 855 rootPart.TrimPermissions();