diff options
author | UbitUmarov | 2017-01-06 17:33:41 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-06 17:33:41 +0000 |
commit | fba2466c16ebb15e15880567db565fecd2f30d7c (patch) | |
tree | ca6b670c91bd1e5915226b90a10c017997db9e4e /OpenSim/Region/Framework | |
parent | add a missing god_date transmition (diff) | |
parent | Merge branch 'master' of opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC_OLD-fba2466c16ebb15e15880567db565fecd2f30d7c.zip opensim-SC_OLD-fba2466c16ebb15e15880567db565fecd2f30d7c.tar.gz opensim-SC_OLD-fba2466c16ebb15e15880567db565fecd2f30d7c.tar.bz2 opensim-SC_OLD-fba2466c16ebb15e15880567db565fecd2f30d7c.tar.xz |
Merge branch 'master' of opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 42 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 19 |
3 files changed, 35 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e3ccf96..cb06540 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -627,6 +627,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
627 | itemCopy.AssetType = item.AssetType; | 627 | itemCopy.AssetType = item.AssetType; |
628 | itemCopy.InvType = item.InvType; | 628 | itemCopy.InvType = item.InvType; |
629 | itemCopy.Folder = recipientFolderId; | 629 | itemCopy.Folder = recipientFolderId; |
630 | itemCopy.Flags = item.Flags; | ||
630 | 631 | ||
631 | if (Permissions.PropagatePermissions() && recipient != senderId) | 632 | if (Permissions.PropagatePermissions() && recipient != senderId) |
632 | { | 633 | { |
@@ -643,7 +644,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
643 | // | 644 | // |
644 | // Transfer | 645 | // Transfer |
645 | // Copy | 646 | // Copy |
646 | // Modufy | 647 | // Modify |
647 | uint permsMask = ~ ((uint)PermissionMask.Copy | | 648 | uint permsMask = ~ ((uint)PermissionMask.Copy | |
648 | (uint)PermissionMask.Transfer | | 649 | (uint)PermissionMask.Transfer | |
649 | (uint)PermissionMask.Modify); | 650 | (uint)PermissionMask.Modify); |
@@ -681,13 +682,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
681 | // a mask | 682 | // a mask |
682 | if (item.InvType == (int)InventoryType.Object) | 683 | if (item.InvType == (int)InventoryType.Object) |
683 | { | 684 | { |
685 | // Create a safe mask for the current perms | ||
686 | uint foldedPerms = (item.CurrentPermissions & 7) << 13; | ||
687 | foldedPerms |= permsMask; | ||
688 | |||
684 | bool isRootMod = (item.CurrentPermissions & | 689 | bool isRootMod = (item.CurrentPermissions & |
685 | (uint)PermissionMask.Modify) != 0 ? | 690 | (uint)PermissionMask.Modify) != 0 ? |
686 | true : false; | 691 | true : false; |
687 | 692 | ||
688 | // Mask the owner perms to the folded perms | 693 | // Mask the owner perms to the folded perms |
689 | PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref ownerPerms); | 694 | ownerPerms &= foldedPerms; |
690 | PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref basePerms); | 695 | basePerms &= foldedPerms; |
691 | 696 | ||
692 | // If the root was mod, let the mask reflect that | 697 | // If the root was mod, let the mask reflect that |
693 | // We also need to adjust the base here, because | 698 | // We also need to adjust the base here, because |
@@ -714,6 +719,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
714 | itemCopy.BasePermissions = basePerms; | 719 | itemCopy.BasePermissions = basePerms; |
715 | itemCopy.CurrentPermissions = ownerPerms; | 720 | itemCopy.CurrentPermissions = ownerPerms; |
716 | itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | 721 | itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
722 | // Need to clear the other inventory slam options. | ||
723 | // That is so we can handle the case where the recipient | ||
724 | // changes the bits in inventory before rezzing | ||
725 | itemCopy.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner); | ||
717 | 726 | ||
718 | itemCopy.NextPermissions = item.NextPermissions; | 727 | itemCopy.NextPermissions = item.NextPermissions; |
719 | 728 | ||
@@ -763,9 +772,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
763 | 772 | ||
764 | itemCopy.GroupID = UUID.Zero; | 773 | itemCopy.GroupID = UUID.Zero; |
765 | itemCopy.GroupOwned = false; | 774 | itemCopy.GroupOwned = false; |
766 | itemCopy.Flags = item.Flags; | 775 | itemCopy.SalePrice = 0; //item.SalePrice; |
767 | itemCopy.SalePrice = item.SalePrice; | 776 | itemCopy.SaleType = 0; //item.SaleType; |
768 | itemCopy.SaleType = item.SaleType; | ||
769 | 777 | ||
770 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); | 778 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); |
771 | if (invAccess != null) | 779 | if (invAccess != null) |
@@ -1240,26 +1248,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1240 | { | 1248 | { |
1241 | agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 1249 | agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); |
1242 | if (taskItem.InvType == (int)InventoryType.Object) | 1250 | if (taskItem.InvType == (int)InventoryType.Object) |
1243 | { | 1251 | agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move)); |
1244 | // Bake the new base permissions from folded permissions | 1252 | else |
1245 | // The folded perms are in the lowest 3 bits of the current perms | 1253 | agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; |
1246 | // We use base permissions here to avoid baking the "Locked" status | ||
1247 | // into the item as it is passed. | ||
1248 | uint perms = taskItem.BasePermissions & taskItem.NextPermissions; | ||
1249 | PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms); | ||
1250 | // Avoid the "lock trap" - move must always be enabled but the above may remove it | ||
1251 | // Add it back here. | ||
1252 | agentItem.BasePermissions = perms | (uint)PermissionMask.Move; | ||
1253 | // Newly given items cannot be "locked" on rez. Make sure by | ||
1254 | // setting current equal to base. | ||
1255 | } | ||
1256 | 1254 | ||
1257 | agentItem.CurrentPermissions = agentItem.BasePermissions; | 1255 | agentItem.CurrentPermissions = agentItem.BasePermissions; |
1258 | 1256 | ||
1259 | agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | 1257 | agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
1258 | agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner); | ||
1260 | agentItem.NextPermissions = taskItem.NextPermissions; | 1259 | agentItem.NextPermissions = taskItem.NextPermissions; |
1261 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 1260 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); |
1262 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; | 1261 | // Group permissions make no sense here |
1262 | agentItem.GroupPermissions = 0; | ||
1263 | } | 1263 | } |
1264 | else | 1264 | else |
1265 | { | 1265 | { |
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1267 | agentItem.CurrentPermissions = taskItem.CurrentPermissions; | 1267 | agentItem.CurrentPermissions = taskItem.CurrentPermissions; |
1268 | agentItem.NextPermissions = taskItem.NextPermissions; | 1268 | agentItem.NextPermissions = taskItem.NextPermissions; |
1269 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions; | 1269 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions; |
1270 | agentItem.GroupPermissions = taskItem.GroupPermissions; | 1270 | agentItem.GroupPermissions = 0; |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | message = null; | 1273 | message = null; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b97cceb..99be06b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -5242,6 +5242,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5242 | BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; | 5242 | BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; |
5243 | OwnerMask &= NextOwnerMask; | 5243 | OwnerMask &= NextOwnerMask; |
5244 | EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; | 5244 | EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; |
5245 | GroupMask = 0; // Giving an object zaps group permissions | ||
5245 | 5246 | ||
5246 | Inventory.ApplyNextOwnerPermissions(); | 5247 | Inventory.ApplyNextOwnerPermissions(); |
5247 | } | 5248 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index a50f162..45c3ebd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -1358,12 +1358,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1358 | { | 1358 | { |
1359 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) | 1359 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) |
1360 | { | 1360 | { |
1361 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | 1361 | // m_log.DebugFormat ( |
1362 | item.CurrentPermissions &= ~(uint)PermissionMask.Copy; | 1362 | // "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}", |
1363 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) | 1363 | // item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions); |
1364 | item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; | 1364 | |
1365 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) | 1365 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) |
1366 | item.CurrentPermissions &= ~(uint)PermissionMask.Modify; | 1366 | { |
1367 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | ||
1368 | item.CurrentPermissions &= ~(uint)PermissionMask.Copy; | ||
1369 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) | ||
1370 | item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; | ||
1371 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) | ||
1372 | item.CurrentPermissions &= ~(uint)PermissionMask.Modify; | ||
1373 | } | ||
1367 | } | 1374 | } |
1368 | item.CurrentPermissions &= item.NextPermissions; | 1375 | item.CurrentPermissions &= item.NextPermissions; |
1369 | item.BasePermissions &= item.NextPermissions; | 1376 | item.BasePermissions &= item.NextPermissions; |