aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs218
1 files changed, 154 insertions, 64 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 62ad2cd..fb142f5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -284,6 +284,7 @@ namespace OpenSim.Region.Environment.Scenes
284 item.Name = itemUpd.Name; 284 item.Name = itemUpd.Name;
285 item.Description = itemUpd.Description; 285 item.Description = itemUpd.Description;
286 item.NextPermissions = itemUpd.NextPermissions; 286 item.NextPermissions = itemUpd.NextPermissions;
287 item.CurrentPermissions |= 8; // Slam!
287 item.EveryOnePermissions = itemUpd.EveryOnePermissions; 288 item.EveryOnePermissions = itemUpd.EveryOnePermissions;
288 289
289 // TODO: Requires sanity checks 290 // TODO: Requires sanity checks
@@ -347,7 +348,13 @@ namespace OpenSim.Region.Environment.Scenes
347 InventoryItemBase item = senderUserInfo.RootFolder.FindItem(itemId); 348 InventoryItemBase item = senderUserInfo.RootFolder.FindItem(itemId);
348 349
349 if (item != null) 350 if (item != null)
350 { 351 {
352 if (!ExternalChecks.ExternalChecksBypassPermissions())
353 {
354 if((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
355 return;
356 }
357
351 // TODO get recipient's root folder 358 // TODO get recipient's root folder
352 CachedUserInfo recipientUserInfo 359 CachedUserInfo recipientUserInfo
353 = CommsManager.UserProfileCacheService.GetUserDetails(recipientClient.AgentId); 360 = CommsManager.UserProfileCacheService.GetUserDetails(recipientClient.AgentId);
@@ -365,12 +372,37 @@ namespace OpenSim.Region.Environment.Scenes
365 itemCopy.AssetType = item.AssetType; 372 itemCopy.AssetType = item.AssetType;
366 itemCopy.InvType = item.InvType; 373 itemCopy.InvType = item.InvType;
367 itemCopy.Folder = recipientUserInfo.RootFolder.ID; 374 itemCopy.Folder = recipientUserInfo.RootFolder.ID;
368 itemCopy.CurrentPermissions = 2147483647; 375 if (ExternalChecks.ExternalChecksPropagatePermissions())
369 itemCopy.NextPermissions = 2147483647; 376 {
370 itemCopy.EveryOnePermissions = item.EveryOnePermissions; 377 if(item.InvType == 6)
371 itemCopy.BasePermissions = item.BasePermissions; 378 {
372 itemCopy.CurrentPermissions = item.CurrentPermissions; 379 itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
373 380 itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13;
381 }
382 else
383 {
384 Console.WriteLine("Non-Prim item ==>");
385 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
386 }
387
388 itemCopy.CurrentPermissions = itemCopy.BasePermissions;
389 if((item.CurrentPermissions & 8) != 0) // Propagate slam bit
390 {
391 itemCopy.CurrentPermissions = item.NextPermissions;
392 itemCopy.BasePermissions=itemCopy.CurrentPermissions;
393 itemCopy.CurrentPermissions |= 8;
394 }
395
396 itemCopy.NextPermissions = item.NextPermissions;
397 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
398 }
399 else
400 {
401 itemCopy.CurrentPermissions = item.CurrentPermissions;
402 itemCopy.NextPermissions = item.NextPermissions;
403 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
404 itemCopy.BasePermissions = item.BasePermissions;
405 }
374 itemCopy.GroupID = item.GroupID; 406 itemCopy.GroupID = item.GroupID;
375 itemCopy.GroupOwned = item.GroupOwned; 407 itemCopy.GroupOwned = item.GroupOwned;
376 itemCopy.Flags = item.Flags; 408 itemCopy.Flags = item.Flags;
@@ -379,6 +411,12 @@ namespace OpenSim.Region.Environment.Scenes
379 411
380 recipientUserInfo.AddItem(itemCopy); 412 recipientUserInfo.AddItem(itemCopy);
381 413
414 if (!ExternalChecks.ExternalChecksBypassPermissions())
415 {
416 if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
417 senderUserInfo.DeleteItem(itemId);
418 }
419
382 // Let the recipient client know about this new item 420 // Let the recipient client know about this new item
383 recipientClient.SendBulkUpdateInventory(itemCopy); 421 recipientClient.SendBulkUpdateInventory(itemCopy);
384 } 422 }
@@ -446,9 +484,16 @@ namespace OpenSim.Region.Environment.Scenes
446 484
447 if (asset != null) 485 if (asset != null)
448 { 486 {
449 // TODO: preserve current permissions? 487 if(remoteClient.AgentId == oldAgentID)
450 CreateNewInventoryItem( 488 {
451 remoteClient, newFolderID, callbackID, asset, item.NextPermissions); 489 CreateNewInventoryItem(
490 remoteClient, newFolderID, callbackID, asset, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions);
491 }
492 else
493 {
494 CreateNewInventoryItem(
495 remoteClient, newFolderID, callbackID, asset, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions);
496 }
452 } 497 }
453 else 498 else
454 { 499 {
@@ -507,7 +552,6 @@ namespace OpenSim.Region.Environment.Scenes
507 552
508 userInfo.DeleteItem(item.ID); 553 userInfo.DeleteItem(item.ID);
509 554
510 // TODO: preserve current permissions?
511 AddInventoryItem(remoteClient, item); 555 AddInventoryItem(remoteClient, item);
512 } 556 }
513 else 557 else
@@ -525,6 +569,12 @@ namespace OpenSim.Region.Environment.Scenes
525 } 569 }
526 } 570 }
527 571
572 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
573 AssetBase asset, uint nextOwnerMask)
574 {
575 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask);
576 }
577
528 /// <summary> 578 /// <summary>
529 /// Create a new inventory item. 579 /// Create a new inventory item.
530 /// </summary> 580 /// </summary>
@@ -534,7 +584,7 @@ namespace OpenSim.Region.Environment.Scenes
534 /// <param name="asset"></param> 584 /// <param name="asset"></param>
535 /// <param name="nextOwnerMask"></param> 585 /// <param name="nextOwnerMask"></param>
536 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, 586 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
537 AssetBase asset, uint nextOwnerMask) 587 AssetBase asset, uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask)
538 { 588 {
539 CachedUserInfo userInfo 589 CachedUserInfo userInfo
540 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 590 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -551,8 +601,10 @@ namespace OpenSim.Region.Environment.Scenes
551 item.AssetType = asset.Type; 601 item.AssetType = asset.Type;
552 item.InvType = asset.InvType; 602 item.InvType = asset.InvType;
553 item.Folder = folderID; 603 item.Folder = folderID;
554 item.CurrentPermissions = 2147483647; 604 item.CurrentPermissions = currentMask;
555 item.NextPermissions = nextOwnerMask; 605 item.NextPermissions = nextOwnerMask;
606 item.EveryOnePermissions = everyoneMask;
607 item.BasePermissions = baseMask;
556 608
557 userInfo.AddItem(item); 609 userInfo.AddItem(item);
558 remoteClient.SendInventoryItemCreateUpdate(item); 610 remoteClient.SendInventoryItemCreateUpdate(item);
@@ -766,9 +818,9 @@ namespace OpenSim.Region.Environment.Scenes
766 /// <param name="itemID"></param> 818 /// <param name="itemID"></param>
767 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) 819 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId)
768 { 820 {
769 SceneObjectGroup group = GetGroupByPrim(primLocalId); 821 SceneObjectPart part = GetSceneObjectPart(primLocalId);
770 822
771 if (null == group) 823 if (null == part)
772 { 824 {
773 m_log.WarnFormat( 825 m_log.WarnFormat(
774 "[PRIM INVENTORY]: " + 826 "[PRIM INVENTORY]: " +
@@ -778,7 +830,7 @@ namespace OpenSim.Region.Environment.Scenes
778 return; 830 return;
779 } 831 }
780 832
781 TaskInventoryItem taskItem = group.GetInventoryItem(primLocalId, itemId); 833 TaskInventoryItem taskItem = part.GetInventoryItem(itemId);
782 834
783 if (null == taskItem) 835 if (null == taskItem)
784 { 836 {
@@ -786,19 +838,9 @@ namespace OpenSim.Region.Environment.Scenes
786 return; 838 return;
787 } 839 }
788 840
789// bool permission; 841 // Only owner can copy
790// permission = Permissions.CanCopyObject(remoteClient.AgentId,
791// ((SceneObjectGroup) selectedEnt).UUID);
792
793 // Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner
794 // to copy
795 if (remoteClient.AgentId != taskItem.OwnerID) 842 if (remoteClient.AgentId != taskItem.OwnerID)
796 { 843 {
797 m_log.InfoFormat(
798 "[PRIM INVENTORY]: Attempt made by {0} {1} to copy inventory item {2} {3} in prim {4} {5},"
799 + " but temporarily not allowed pending upstream bugfixes/feature implementation",
800 remoteClient.Name, remoteClient.AgentId, taskItem.Name, taskItem.ItemID, group.Name, group.UUID);
801
802 return; 844 return;
803 } 845 }
804 846
@@ -813,22 +855,29 @@ namespace OpenSim.Region.Environment.Scenes
813 agentItem.AssetType = taskItem.Type; 855 agentItem.AssetType = taskItem.Type;
814 agentItem.InvType = taskItem.InvType; 856 agentItem.InvType = taskItem.InvType;
815 agentItem.Folder = folderId; 857 agentItem.Folder = folderId;
816 agentItem.EveryOnePermissions = taskItem.EveryoneMask;
817 858
818 if (remoteClient.AgentId != taskItem.OwnerID) 859 if ((remoteClient.AgentId != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
819 { 860 {
820 agentItem.BasePermissions = taskItem.NextOwnerMask; 861 agentItem.BasePermissions = taskItem.NextOwnerMask;
821 agentItem.CurrentPermissions = taskItem.NextOwnerMask; 862 agentItem.CurrentPermissions = taskItem.NextOwnerMask;
822 agentItem.NextPermissions = taskItem.NextOwnerMask; 863 agentItem.NextPermissions = taskItem.NextOwnerMask;
864 agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask;
823 } 865 }
824 else 866 else
825 { 867 {
826 agentItem.BasePermissions = taskItem.BaseMask; 868 agentItem.BasePermissions = taskItem.BaseMask;
827 agentItem.CurrentPermissions = taskItem.OwnerMask; 869 agentItem.CurrentPermissions = taskItem.OwnerMask;
828 agentItem.NextPermissions = taskItem.NextOwnerMask; 870 agentItem.NextPermissions = taskItem.NextOwnerMask;
871 agentItem.EveryOnePermissions = taskItem.EveryoneMask;
829 } 872 }
830 873
831 AddInventoryItem(remoteClient, agentItem); 874 AddInventoryItem(remoteClient, agentItem);
875 if (!ExternalChecks.ExternalChecksBypassPermissions())
876 {
877 if((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
878 part.RemoveInventoryItem(itemId);
879 }
880
832 } 881 }
833 882
834 /// <summary> 883 /// <summary>
@@ -842,9 +891,9 @@ namespace OpenSim.Region.Environment.Scenes
842 public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, 891 public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID,
843 uint primLocalID) 892 uint primLocalID)
844 { 893 {
845 SceneObjectGroup group = GetGroupByPrim(primLocalID); 894 SceneObjectPart part = GetSceneObjectPart(primLocalID);
846 895
847 if (group != null) 896 if (part != null)
848 { 897 {
849 LLUUID copyID = LLUUID.Random(); 898 LLUUID copyID = LLUUID.Random();
850 if (itemID != LLUUID.Zero) 899 if (itemID != LLUUID.Zero)
@@ -864,11 +913,16 @@ namespace OpenSim.Region.Environment.Scenes
864 913
865 if (item != null) 914 if (item != null)
866 { 915 {
867 group.AddInventoryItem(remoteClient, primLocalID, item, copyID); 916 part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID);
868 m_log.InfoFormat( 917 m_log.InfoFormat(
869 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", 918 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
870 item.Name, primLocalID, remoteClient.Name); 919 item.Name, primLocalID, remoteClient.Name);
871 group.GetProperties(remoteClient); 920 part.ParentGroup.GetProperties(remoteClient);
921 if (!ExternalChecks.ExternalChecksBypassPermissions())
922 {
923 if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
924 RemoveInventoryItem(remoteClient, itemID);
925 }
872 } 926 }
873 else 927 else
874 { 928 {
@@ -915,12 +969,12 @@ namespace OpenSim.Region.Environment.Scenes
915 969
916 if (item != null) 970 if (item != null)
917 { 971 {
918 SceneObjectGroup group = GetGroupByPrim(localID); 972 SceneObjectPart part = GetSceneObjectPart(localID);
919 if (group != null) 973 if (part != null)
920 { 974 {
921 group.AddInventoryItem(remoteClient, localID, item, copyID); 975 part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
922 group.StartScript(localID, copyID); 976 part.ParentGroup.StartScript(localID, copyID);
923 group.GetProperties(remoteClient); 977 part.ParentGroup.GetProperties(remoteClient);
924 978
925 // m_log.InfoFormat("[PRIMINVENTORY]: " + 979 // m_log.InfoFormat("[PRIMINVENTORY]: " +
926 // "Rezzed script {0} into prim local ID {1} for user {2}", 980 // "Rezzed script {0} into prim local ID {1} for user {2}",
@@ -959,7 +1013,7 @@ namespace OpenSim.Region.Environment.Scenes
959 /// <param name="packet"></param> 1013 /// <param name="packet"></param>
960 /// <param name="simClient"></param> 1014 /// <param name="simClient"></param>
961 public virtual void DeRezObject(Packet packet, IClientAPI remoteClient) 1015 public virtual void DeRezObject(Packet packet, IClientAPI remoteClient)
962 { 1016 {
963 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet; 1017 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet;
964 1018
965 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero) 1019 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero)
@@ -1038,18 +1092,21 @@ namespace OpenSim.Region.Environment.Scenes
1038 item.AssetType = asset.Type; 1092 item.AssetType = asset.Type;
1039 item.InvType = asset.InvType; 1093 item.InvType = asset.InvType;
1040 item.Folder = DeRezPacket.AgentBlock.DestinationID; 1094 item.Folder = DeRezPacket.AgentBlock.DestinationID;
1041 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1095 if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
1042 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID)
1043 { 1096 {
1044 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1097 objectGroup.ApplyNextOwnerPermissions();
1045 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1098
1046 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1099 item.BasePermissions = objectGroup.GetEffectivePermissions() & objectGroup.RootPart.NextOwnerMask;
1100 item.CurrentPermissions = objectGroup.GetEffectivePermissions() & objectGroup.RootPart.NextOwnerMask;
1101 item.NextPermissions = objectGroup.GetEffectivePermissions() & objectGroup.RootPart.NextOwnerMask;
1102 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1047 } 1103 }
1048 else 1104 else
1049 { 1105 {
1050 item.BasePermissions = objectGroup.RootPart.BaseMask; 1106 item.BasePermissions = objectGroup.GetEffectivePermissions();
1051 item.CurrentPermissions = objectGroup.RootPart.OwnerMask; 1107 item.CurrentPermissions = objectGroup.GetEffectivePermissions();
1052 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1108 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1109 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1053 } 1110 }
1054 1111
1055 // TODO: add the new fields (Flags, Sale info, etc) 1112 // TODO: add the new fields (Flags, Sale info, etc)
@@ -1068,6 +1125,7 @@ namespace OpenSim.Region.Environment.Scenes
1068 } 1125 }
1069 } 1126 }
1070 } 1127 }
1128
1071 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID assetID, LLUUID agentID) 1129 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID assetID, LLUUID agentID)
1072 { 1130 {
1073 SceneObjectGroup objectGroup = grp; 1131 SceneObjectGroup objectGroup = grp;
@@ -1130,19 +1188,20 @@ namespace OpenSim.Region.Environment.Scenes
1130 // Sticking it in root folder for now.. objects folder later? 1188 // Sticking it in root folder for now.. objects folder later?
1131 1189
1132 item.Folder = foundFolder;// DeRezPacket.AgentBlock.DestinationID; 1190 item.Folder = foundFolder;// DeRezPacket.AgentBlock.DestinationID;
1133 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1191 if ((agentID != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
1134 if (agentID != objectGroup.RootPart.OwnerID)
1135 { 1192 {
1136 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1193 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
1137 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1194 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
1138 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1195 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1196 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1139 } 1197 }
1140 else 1198 else
1141 { 1199 {
1142 item.BasePermissions = objectGroup.RootPart.BaseMask; 1200 item.BasePermissions = objectGroup.GetEffectivePermissions();
1143 item.CurrentPermissions = objectGroup.RootPart.OwnerMask; 1201 item.CurrentPermissions = objectGroup.GetEffectivePermissions();
1144 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1202 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1145 } 1203 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1204 }
1146 1205
1147 userInfo.AddItem(item); 1206 userInfo.AddItem(item);
1148 1207
@@ -1187,18 +1246,19 @@ namespace OpenSim.Region.Environment.Scenes
1187 // Sticking it in root folder for now.. objects folder later? 1246 // Sticking it in root folder for now.. objects folder later?
1188 1247
1189 item.Folder = userInfo.RootFolder.ID;// DeRezPacket.AgentBlock.DestinationID; 1248 item.Folder = userInfo.RootFolder.ID;// DeRezPacket.AgentBlock.DestinationID;
1190 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1249 if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
1191 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID)
1192 { 1250 {
1193 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1251 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
1194 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1252 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
1195 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1253 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1254 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1196 } 1255 }
1197 else 1256 else
1198 { 1257 {
1199 item.BasePermissions = objectGroup.RootPart.BaseMask; 1258 item.BasePermissions = objectGroup.RootPart.BaseMask;
1200 item.CurrentPermissions = objectGroup.RootPart.OwnerMask; 1259 item.CurrentPermissions = objectGroup.RootPart.OwnerMask;
1201 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1260 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1261 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1202 } 1262 }
1203 1263
1204 userInfo.AddItem(item); 1264 userInfo.AddItem(item);
@@ -1344,18 +1404,33 @@ namespace OpenSim.Region.Environment.Scenes
1344 rootPart.Description = item.Description; 1404 rootPart.Description = item.Description;
1345 1405
1346 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); 1406 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
1407
1408 if(rootPart.OwnerID != item.Owner)
1409 {
1410 if((item.CurrentPermissions & 8) != 0)
1411 {
1412 foreach (SceneObjectPart part in partList)
1413 {
1414 part.EveryoneMask = item.EveryOnePermissions;
1415 part.NextOwnerMask = item.NextPermissions;
1416 }
1417 }
1418 group.ApplyNextOwnerPermissions();
1419 }
1420
1347 foreach (SceneObjectPart part in partList) 1421 foreach (SceneObjectPart part in partList)
1348 { 1422 {
1349 if (part.OwnerID != item.Owner) 1423 if (part.OwnerID != item.Owner)
1350 { 1424 {
1351 part.LastOwnerID = part.OwnerID; 1425 part.LastOwnerID = part.OwnerID;
1352 part.OwnerID = item.Owner; 1426 part.OwnerID = item.Owner;
1353 part.EveryoneMask = item.EveryOnePermissions;
1354 part.BaseMask = item.BasePermissions;
1355 part.OwnerMask = item.CurrentPermissions;
1356 part.NextOwnerMask = item.NextPermissions;
1357 part.ChangeInventoryOwner(item.Owner); 1427 part.ChangeInventoryOwner(item.Owner);
1358 } 1428 }
1429 else if(((item.CurrentPermissions & 8) != 0) && (!attachment)) // Slam!
1430 {
1431 part.EveryoneMask = item.EveryOnePermissions;
1432 part.NextOwnerMask = item.NextPermissions;
1433 }
1359 } 1434 }
1360 1435
1361 rootPart.TrimPermissions(); 1436 rootPart.TrimPermissions();
@@ -1421,18 +1496,33 @@ namespace OpenSim.Region.Environment.Scenes
1421 rootPart.Description = item.Description; 1496 rootPart.Description = item.Description;
1422 1497
1423 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); 1498 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
1499
1500 if(rootPart.OwnerID != item.OwnerID)
1501 {
1502 if((item.OwnerMask & 8) != 0)
1503 {
1504 foreach (SceneObjectPart part in partList)
1505 {
1506 part.EveryoneMask = item.EveryoneMask;
1507 part.NextOwnerMask = item.NextOwnerMask;
1508 }
1509 }
1510 group.ApplyNextOwnerPermissions();
1511 }
1512
1424 foreach (SceneObjectPart part in partList) 1513 foreach (SceneObjectPart part in partList)
1425 { 1514 {
1426 if (part.OwnerID != item.OwnerID) 1515 if (part.OwnerID != item.OwnerID)
1427 { 1516 {
1428 part.LastOwnerID = part.OwnerID; 1517 part.LastOwnerID = part.OwnerID;
1429 part.OwnerID = item.OwnerID; 1518 part.OwnerID = item.OwnerID;
1430 part.EveryoneMask = item.EveryoneMask;
1431 part.BaseMask = item.BaseMask;
1432 part.OwnerMask = item.OwnerMask;
1433 part.NextOwnerMask = item.NextOwnerMask;
1434 part.ChangeInventoryOwner(item.OwnerID); 1519 part.ChangeInventoryOwner(item.OwnerID);
1435 } 1520 }
1521 else if((item.OwnerMask & 8) != 0) // Slam!
1522 {
1523 part.EveryoneMask = item.EveryoneMask;
1524 part.NextOwnerMask = item.NextOwnerMask;
1525 }
1436 } 1526 }
1437 rootPart.TrimPermissions(); 1527 rootPart.TrimPermissions();
1438 if (group.RootPart.Shape.PCode == (byte)PCode.Prim) 1528 if (group.RootPart.Shape.PCode == (byte)PCode.Prim)