aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs22
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs19
3 files changed, 21 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 1b3fdc3..1973bcb 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -303,6 +303,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
303 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory; 303 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;
304 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; 304 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory;
305 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; 305 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory;
306 m_scene.Permissions.OnDoObjectInvToObjectInv += CanDoObjectInvToObjectInv;
306 307
307 m_scene.Permissions.OnViewNotecard += CanViewNotecard; 308 m_scene.Permissions.OnViewNotecard += CanViewNotecard;
308 m_scene.Permissions.OnViewScript += CanViewScript; 309 m_scene.Permissions.OnViewScript += CanViewScript;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index a1eb721..29666d5 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1461,28 +1461,8 @@ namespace OpenSim.Region.Framework.Scenes
1461 return; 1461 return;
1462 } 1462 }
1463 1463
1464 // Can't transfer this 1464 if(!Permissions.CanDoObjectInvToObjectInv(srcTaskItem, part, destPart))
1465 //
1466 if (part.OwnerID != destPart.OwnerID && (srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
1467 return;
1468
1469 bool overrideNoMod = false;
1470 if ((part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0)
1471 overrideNoMod = true;
1472
1473 if (part.OwnerID != destPart.OwnerID && (destPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0)
1474 {
1475 // object cannot copy items to an object owned by a different owner
1476 // unless llAllowInventoryDrop has been called
1477
1478 return; 1465 return;
1479 }
1480
1481 // must have both move and modify permission to put an item in an object
1482 if (((part.OwnerMask & (uint)PermissionMask.Modify) == 0) && (!overrideNoMod))
1483 {
1484 return;
1485 }
1486 1466
1487 TaskInventoryItem destTaskItem = new TaskInventoryItem(); 1467 TaskInventoryItem destTaskItem = new TaskInventoryItem();
1488 1468
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index 754609a..968b298 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -86,6 +86,7 @@ namespace OpenSim.Region.Framework.Scenes
86 public delegate bool DelinkObjectHandler(UUID user, UUID objectID); 86 public delegate bool DelinkObjectHandler(UUID user, UUID objectID);
87 public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID); 87 public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID);
88 public delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); 88 public delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID);
89 public delegate bool DoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart sourcePart, SceneObjectPart destPart);
89 public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); 90 public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID);
90 public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); 91 public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID);
91 public delegate bool CreateUserInventoryHandler(int invType, UUID userID); 92 public delegate bool CreateUserInventoryHandler(int invType, UUID userID);
@@ -158,6 +159,7 @@ namespace OpenSim.Region.Framework.Scenes
158 public event DelinkObjectHandler OnDelinkObject; 159 public event DelinkObjectHandler OnDelinkObject;
159 public event CreateObjectInventoryHandler OnCreateObjectInventory; 160 public event CreateObjectInventoryHandler OnCreateObjectInventory;
160 public event CopyObjectInventoryHandler OnCopyObjectInventory; 161 public event CopyObjectInventoryHandler OnCopyObjectInventory;
162 public event DoObjectInvToObjectInv OnDoObjectInvToObjectInv;
161 public event DeleteObjectInventoryHandler OnDeleteObjectInventory; 163 public event DeleteObjectInventoryHandler OnDeleteObjectInventory;
162 public event TransferObjectInventoryHandler OnTransferObjectInventory; 164 public event TransferObjectInventoryHandler OnTransferObjectInventory;
163 public event CreateUserInventoryHandler OnCreateUserInventory; 165 public event CreateUserInventoryHandler OnCreateUserInventory;
@@ -1090,6 +1092,23 @@ namespace OpenSim.Region.Framework.Scenes
1090 return true; 1092 return true;
1091 } 1093 }
1092 1094
1095 public bool CanDoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart sourcePart, SceneObjectPart destPart)
1096 {
1097 DoObjectInvToObjectInv handler = OnDoObjectInvToObjectInv;
1098 if (handler != null)
1099 {
1100 if (sourcePart == null || destPart == null || item == null)
1101 return false;
1102 Delegate[] list = handler.GetInvocationList();
1103 foreach (DoObjectInvToObjectInv h in list)
1104 {
1105 if (h(item, sourcePart, destPart) == false)
1106 return false;
1107 }
1108 }
1109 return true;
1110 }
1111
1093 public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID) 1112 public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID)
1094 { 1113 {
1095 DeleteObjectInventoryHandler handler = OnDeleteObjectInventory; 1114 DeleteObjectInventoryHandler handler = OnDeleteObjectInventory;