aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Permissions.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index 968b298..4630497 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -87,6 +87,7 @@ namespace OpenSim.Region.Framework.Scenes
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 DoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart sourcePart, SceneObjectPart destPart);
90 public delegate bool DoDropInObjectInv(InventoryItemBase item, ScenePresence sp, SceneObjectPart destPart);
90 public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); 91 public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID);
91 public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); 92 public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID);
92 public delegate bool CreateUserInventoryHandler(int invType, UUID userID); 93 public delegate bool CreateUserInventoryHandler(int invType, UUID userID);
@@ -160,6 +161,7 @@ namespace OpenSim.Region.Framework.Scenes
160 public event CreateObjectInventoryHandler OnCreateObjectInventory; 161 public event CreateObjectInventoryHandler OnCreateObjectInventory;
161 public event CopyObjectInventoryHandler OnCopyObjectInventory; 162 public event CopyObjectInventoryHandler OnCopyObjectInventory;
162 public event DoObjectInvToObjectInv OnDoObjectInvToObjectInv; 163 public event DoObjectInvToObjectInv OnDoObjectInvToObjectInv;
164 public event DoDropInObjectInv OnDropInObjectInv;
163 public event DeleteObjectInventoryHandler OnDeleteObjectInventory; 165 public event DeleteObjectInventoryHandler OnDeleteObjectInventory;
164 public event TransferObjectInventoryHandler OnTransferObjectInventory; 166 public event TransferObjectInventoryHandler OnTransferObjectInventory;
165 public event CreateUserInventoryHandler OnCreateUserInventory; 167 public event CreateUserInventoryHandler OnCreateUserInventory;
@@ -1109,6 +1111,28 @@ namespace OpenSim.Region.Framework.Scenes
1109 return true; 1111 return true;
1110 } 1112 }
1111 1113
1114 public bool CanDropInObjectInv(InventoryItemBase item, IClientAPI client, SceneObjectPart destPart)
1115 {
1116 DoDropInObjectInv handler = OnDropInObjectInv;
1117 if (handler != null)
1118 {
1119 if (client == null || client.SceneAgent == null|| destPart == null || item == null)
1120 return false;
1121
1122 ScenePresence sp = client.SceneAgent as ScenePresence;
1123 if(sp == null || sp.IsDeleted)
1124 return false;
1125
1126 Delegate[] list = handler.GetInvocationList();
1127 foreach (DoDropInObjectInv h in list)
1128 {
1129 if (h(item, sp, destPart) == false)
1130 return false;
1131 }
1132 }
1133 return true;
1134 }
1135
1112 public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID) 1136 public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID)
1113 { 1137 {
1114 DeleteObjectInventoryHandler handler = OnDeleteObjectInventory; 1138 DeleteObjectInventoryHandler handler = OnDeleteObjectInventory;