diff options
author | Diva Canto | 2009-08-13 17:34:15 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-13 17:34:15 -0700 |
commit | 034c9cf606373bfa9d3f8040cd787f789e0efbf2 (patch) | |
tree | f586e4a8247fdf92e730bb7a8c296559e144d0a8 /OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory | |
parent | Renamed QueryItem/QueryFolder to GetItem/GetFolder. The word 'query' starting... (diff) | |
download | opensim-SC_OLD-034c9cf606373bfa9d3f8040cd787f789e0efbf2.zip opensim-SC_OLD-034c9cf606373bfa9d3f8040cd787f789e0efbf2.tar.gz opensim-SC_OLD-034c9cf606373bfa9d3f8040cd787f789e0efbf2.tar.bz2 opensim-SC_OLD-034c9cf606373bfa9d3f8040cd787f789e0efbf2.tar.xz |
Added GetAssetPermissions. Few last bugs nixed. This is ready for testing.
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory')
4 files changed, 36 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index 0526bc4..ef5ffe1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | |||
@@ -82,7 +82,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
82 | /// </summary> | 82 | /// </summary> |
83 | /// <param name="userID"></param> | 83 | /// <param name="userID"></param> |
84 | /// <returns>null if no root folder was found</returns> | 84 | /// <returns>null if no root folder was found</returns> |
85 | public abstract InventoryFolderBase GetRootFolder(UUID userID); | 85 | public InventoryFolderBase GetRootFolder(UUID userID) |
86 | { | ||
87 | // Root folder is here as system type Folder. | ||
88 | return m_cache.GetFolderForType(userID, AssetType.Folder); | ||
89 | } | ||
86 | 90 | ||
87 | public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID); | 91 | public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID); |
88 | 92 | ||
@@ -202,5 +206,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
202 | /// <returns></returns> | 206 | /// <returns></returns> |
203 | public abstract List<InventoryItemBase> GetActiveGestures(UUID userId); | 207 | public abstract List<InventoryItemBase> GetActiveGestures(UUID userId); |
204 | 208 | ||
209 | public abstract int GetAssetPermissions(UUID userID, UUID assetID); | ||
205 | } | 210 | } |
206 | } | 211 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index db4e7f4..fd12a57 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -263,6 +263,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
263 | folders[(AssetType)folder.Type] = folder; | 263 | folders[(AssetType)folder.Type] = folder; |
264 | } | 264 | } |
265 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: System folders count for {0}: {1}", userID, folders.Count); | 265 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: System folders count for {0}: {1}", userID, folders.Count); |
266 | // Put the root folder there, as type Folder | ||
267 | folders[AssetType.Folder] = root; | ||
266 | return folders; | 268 | return folders; |
267 | } | 269 | } |
268 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Root folder content not found for {0}", userID); | 270 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Root folder content not found for {0}", userID); |
@@ -422,14 +424,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
422 | return false; | 424 | return false; |
423 | } | 425 | } |
424 | 426 | ||
425 | public override InventoryFolderBase GetRootFolder(UUID userID) | 427 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
426 | { | 428 | { |
427 | return null; | 429 | return new List<InventoryItemBase>(); |
428 | } | 430 | } |
429 | 431 | ||
430 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) | 432 | public override int GetAssetPermissions(UUID userID, UUID assetID) |
431 | { | 433 | { |
432 | return new List<InventoryItemBase>(); | 434 | if (IsLocalGridUser(userID)) |
435 | return m_GridService.GetAssetPermissions(userID, assetID); | ||
436 | else | ||
437 | { | ||
438 | UUID sessionID = GetSessionID(userID); | ||
439 | string uri = GetUserInventoryURI(userID) + "/" + userID.ToString(); | ||
440 | return m_HGService.GetAssetPermissions(uri, assetID, sessionID); | ||
441 | } | ||
433 | } | 442 | } |
434 | 443 | ||
435 | #endregion | 444 | #endregion |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index ccf06d1..2fbc5fe 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -201,8 +201,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
201 | foreach (InventoryFolderBase folder in content.Folders) | 201 | foreach (InventoryFolderBase folder in content.Folders) |
202 | { | 202 | { |
203 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) | 203 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) |
204 | { | ||
205 | m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type); | ||
204 | folders[(AssetType)folder.Type] = folder; | 206 | folders[(AssetType)folder.Type] = folder; |
207 | } | ||
205 | } | 208 | } |
209 | // Put the root folder there, as type Folder | ||
210 | folders[AssetType.Folder] = root; | ||
211 | m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type); | ||
212 | |||
206 | return folders; | 213 | return folders; |
207 | } | 214 | } |
208 | } | 215 | } |
@@ -312,19 +319,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
312 | return m_InventoryService.HasInventoryForUser(userID); | 319 | return m_InventoryService.HasInventoryForUser(userID); |
313 | } | 320 | } |
314 | 321 | ||
315 | /// <summary> | 322 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
316 | /// Retrieve the root inventory folder for the given user. | ||
317 | /// </summary> | ||
318 | /// <param name="userID"></param> | ||
319 | /// <returns>null if no root folder was found</returns> | ||
320 | public override InventoryFolderBase GetRootFolder(UUID userID) | ||
321 | { | 323 | { |
322 | return m_InventoryService.GetRootFolder(userID); | 324 | return m_InventoryService.GetActiveGestures(userId); |
323 | } | 325 | } |
324 | 326 | ||
325 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) | 327 | public override int GetAssetPermissions(UUID userID, UUID assetID) |
326 | { | 328 | { |
327 | return m_InventoryService.GetActiveGestures(userId); | 329 | return m_InventoryService.GetAssetPermissions(userID, assetID); |
328 | } | 330 | } |
329 | #endregion IInventoryService | 331 | #endregion IInventoryService |
330 | } | 332 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 4f19573..e4bb865 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -296,16 +296,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
296 | return false; | 296 | return false; |
297 | } | 297 | } |
298 | 298 | ||
299 | public override InventoryFolderBase GetRootFolder(UUID userID) | 299 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
300 | { | 300 | { |
301 | return null; | 301 | return new List<InventoryItemBase>(); |
302 | } | 302 | } |
303 | 303 | ||
304 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) | 304 | public override int GetAssetPermissions(UUID userID, UUID assetID) |
305 | { | 305 | { |
306 | return new List<InventoryItemBase>(); | 306 | UUID sessionID = GetSessionID(userID); |
307 | return m_RemoteConnector.GetAssetPermissions(userID.ToString(), assetID, sessionID); | ||
307 | } | 308 | } |
308 | 309 | ||
310 | |||
309 | #endregion | 311 | #endregion |
310 | 312 | ||
311 | private UUID GetSessionID(UUID userID) | 313 | private UUID GetSessionID(UUID userID) |