diff options
Diffstat (limited to 'OpenSim/Server/Handlers/Inventory')
-rw-r--r-- | OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs index 30b3cae..6ef1d9d 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs | |||
@@ -105,8 +105,8 @@ namespace OpenSim.Server.Handlers.Inventory | |||
105 | "POST", "/PurgeFolder/", m_InventoryService.PurgeFolder, CheckAuthSession)); | 105 | "POST", "/PurgeFolder/", m_InventoryService.PurgeFolder, CheckAuthSession)); |
106 | 106 | ||
107 | m_httpServer.AddStreamHandler( | 107 | m_httpServer.AddStreamHandler( |
108 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( | 108 | new RestDeserialiseSecureHandler<List<Guid>, bool>( |
109 | "POST", "/DeleteItem/", m_InventoryService.DeleteItem, CheckAuthSession)); | 109 | "POST", "/DeleteItem/", DeleteItems, CheckAuthSession)); |
110 | 110 | ||
111 | m_httpServer.AddStreamHandler( | 111 | m_httpServer.AddStreamHandler( |
112 | new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( | 112 | new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( |
@@ -125,8 +125,8 @@ namespace OpenSim.Server.Handlers.Inventory | |||
125 | "POST", "/NewFolder/", m_InventoryService.AddFolder, CheckAuthSession)); | 125 | "POST", "/NewFolder/", m_InventoryService.AddFolder, CheckAuthSession)); |
126 | 126 | ||
127 | m_httpServer.AddStreamHandler( | 127 | m_httpServer.AddStreamHandler( |
128 | new RestDeserialiseTrustedHandler<InventoryFolderBase, bool>( | 128 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( |
129 | "POST", "/CreateFolder/", m_InventoryService.AddFolder, CheckTrustSource)); | 129 | "POST", "/CreateFolder/", m_InventoryService.AddFolder, CheckAuthSession)); |
130 | 130 | ||
131 | m_httpServer.AddStreamHandler( | 131 | m_httpServer.AddStreamHandler( |
132 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( | 132 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( |
@@ -137,9 +137,13 @@ namespace OpenSim.Server.Handlers.Inventory | |||
137 | "POST", "/AddNewItem/", m_InventoryService.AddItem, CheckTrustSource)); | 137 | "POST", "/AddNewItem/", m_InventoryService.AddItem, CheckTrustSource)); |
138 | 138 | ||
139 | m_httpServer.AddStreamHandler( | 139 | m_httpServer.AddStreamHandler( |
140 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>>( | 140 | new RestDeserialiseSecureHandler<Guid, List<InventoryItemBase>>( |
141 | "POST", "/GetItems/", GetFolderItems, CheckTrustSource)); | 141 | "POST", "/GetItems/", GetFolderItems, CheckAuthSession)); |
142 | 142 | ||
143 | m_httpServer.AddStreamHandler( | ||
144 | new RestDeserialiseSecureHandler<List<InventoryItemBase>, bool>( | ||
145 | "POST", "/MoveItems/", MoveItems, CheckAuthSession)); | ||
146 | |||
143 | // for persistent active gestures | 147 | // for persistent active gestures |
144 | m_httpServer.AddStreamHandler( | 148 | m_httpServer.AddStreamHandler( |
145 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>> | 149 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>> |
@@ -247,6 +251,24 @@ namespace OpenSim.Server.Handlers.Inventory | |||
247 | return m_InventoryService.GetAssetPermissions(item.Owner, item.AssetID); | 251 | return m_InventoryService.GetAssetPermissions(item.Owner, item.AssetID); |
248 | } | 252 | } |
249 | 253 | ||
254 | public bool DeleteItems(List<Guid> items) | ||
255 | { | ||
256 | List<UUID> uuids = new List<UUID>(); | ||
257 | foreach (Guid g in items) | ||
258 | uuids.Add(new UUID(g)); | ||
259 | // oops we lost the user info here. Bad bad handlers | ||
260 | return m_InventoryService.DeleteItems(UUID.Zero, uuids); | ||
261 | } | ||
262 | |||
263 | public bool MoveItems(List<InventoryItemBase> items) | ||
264 | { | ||
265 | // oops we lost the user info here. Bad bad handlers | ||
266 | // let's peek at one item | ||
267 | UUID ownerID = UUID.Zero; | ||
268 | if (items.Count > 0) | ||
269 | ownerID = items[0].Owner; | ||
270 | return m_InventoryService.MoveItems(ownerID, items); | ||
271 | } | ||
250 | #endregion | 272 | #endregion |
251 | 273 | ||
252 | /// <summary> | 274 | /// <summary> |