aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs27
1 files changed, 24 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index bf56de2..b53c355 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -360,7 +360,7 @@ namespace OpenSim.Region.Framework.Scenes
360// m_log.DebugFormat("[PRIM INVENTORY]: Starting script {0} {1} in prim {2} {3} in {4}", 360// m_log.DebugFormat("[PRIM INVENTORY]: Starting script {0} {1} in prim {2} {3} in {4}",
361// item.Name, item.ItemID, m_part.Name, m_part.UUID, m_part.ParentGroup.Scene.RegionInfo.RegionName); 361// item.Name, item.ItemID, m_part.Name, m_part.UUID, m_part.ParentGroup.Scene.RegionInfo.RegionName);
362 362
363 if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) 363 if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item, m_part))
364 { 364 {
365 StoreScriptError(item.ItemID, "no permission"); 365 StoreScriptError(item.ItemID, "no permission");
366 return false; 366 return false;
@@ -807,6 +807,7 @@ namespace OpenSim.Region.Framework.Scenes
807 else 807 else
808 m_part.TriggerScriptChangedEvent(Changed.INVENTORY); 808 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
809 809
810 m_part.AggregateInnerPerms();
810 m_inventorySerial++; 811 m_inventorySerial++;
811 //m_inventorySerial += 2; 812 //m_inventorySerial += 2;
812 HasInventoryChanged = true; 813 HasInventoryChanged = true;
@@ -829,7 +830,7 @@ namespace OpenSim.Region.Framework.Scenes
829// m_part.TriggerScriptChangedEvent(Changed.INVENTORY); 830// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
830 } 831 }
831 m_items.LockItemsForWrite(false); 832 m_items.LockItemsForWrite(false);
832 833 m_part.AggregateInnerPerms();
833 m_inventorySerial++; 834 m_inventorySerial++;
834 } 835 }
835 836
@@ -965,7 +966,8 @@ namespace OpenSim.Region.Framework.Scenes
965 { 966 {
966 if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) 967 if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
967 { 968 {
968 part.LastOwnerID = part.OwnerID; 969 if(part.GroupID != part.OwnerID)
970 part.LastOwnerID = part.OwnerID;
969 part.OwnerID = item.OwnerID; 971 part.OwnerID = item.OwnerID;
970 part.Inventory.ChangeInventoryOwner(item.OwnerID); 972 part.Inventory.ChangeInventoryOwner(item.OwnerID);
971 } 973 }
@@ -979,6 +981,7 @@ namespace OpenSim.Region.Framework.Scenes
979 } 981 }
980// old code end 982// old code end
981 rootPart.TrimPermissions(); 983 rootPart.TrimPermissions();
984 group.AggregateDeepPerms();
982 } 985 }
983 986
984 return true; 987 return true;
@@ -1020,16 +1023,20 @@ namespace OpenSim.Region.Framework.Scenes
1020 item.AssetID = m_items[item.ItemID].AssetID; 1023 item.AssetID = m_items[item.ItemID].AssetID;
1021 1024
1022 m_items[item.ItemID] = item; 1025 m_items[item.ItemID] = item;
1026
1023 m_inventorySerial++; 1027 m_inventorySerial++;
1024 if (fireScriptEvents) 1028 if (fireScriptEvents)
1025 m_part.TriggerScriptChangedEvent(Changed.INVENTORY); 1029 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
1026 1030
1027 if (considerChanged) 1031 if (considerChanged)
1028 { 1032 {
1033 m_part.AggregateInnerPerms();
1034 m_part.ParentGroup.AggregatePerms();
1029 HasInventoryChanged = true; 1035 HasInventoryChanged = true;
1030 m_part.ParentGroup.HasGroupChanged = true; 1036 m_part.ParentGroup.HasGroupChanged = true;
1031 } 1037 }
1032 m_items.LockItemsForWrite(false); 1038 m_items.LockItemsForWrite(false);
1039
1033 return true; 1040 return true;
1034 } 1041 }
1035 else 1042 else
@@ -1066,6 +1073,10 @@ namespace OpenSim.Region.Framework.Scenes
1066 m_items.LockItemsForWrite(true); 1073 m_items.LockItemsForWrite(true);
1067 m_items.Remove(itemID); 1074 m_items.Remove(itemID);
1068 m_items.LockItemsForWrite(false); 1075 m_items.LockItemsForWrite(false);
1076
1077 m_part.AggregateInnerPerms();
1078 m_part.ParentGroup.AggregatePerms();
1079
1069 m_inventorySerial++; 1080 m_inventorySerial++;
1070 m_part.TriggerScriptChangedEvent(Changed.INVENTORY); 1081 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
1071 1082
@@ -1317,6 +1328,16 @@ namespace OpenSim.Region.Framework.Scenes
1317 } 1328 }
1318 } 1329 }
1319 1330
1331 public void AggregateInnerPerms(ref uint owner, ref uint group, ref uint everyone)
1332 {
1333 foreach (TaskInventoryItem item in m_items.Values)
1334 {
1335 owner &= item.CurrentPermissions;
1336 group &= item.GroupPermissions;
1337 everyone &= item.EveryonePermissions;
1338 }
1339 }
1340
1320 public uint MaskEffectivePermissions() 1341 public uint MaskEffectivePermissions()
1321 { 1342 {
1322 uint mask=0x7fffffff; 1343 uint mask=0x7fffffff;