aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorDiva Canto2009-08-13 17:34:15 -0700
committerDiva Canto2009-08-13 17:34:15 -0700
commit034c9cf606373bfa9d3f8040cd787f789e0efbf2 (patch)
treef586e4a8247fdf92e730bb7a8c296559e144d0a8 /OpenSim/Services/Connectors
parentRenamed QueryItem/QueryFolder to GetItem/GetFolder. The word 'query' starting... (diff)
downloadopensim-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/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs14
-rw-r--r--OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs2
-rw-r--r--OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs49
-rw-r--r--OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs5
4 files changed, 54 insertions, 16 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
index f6d1500..94b4ad9 100644
--- a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
@@ -149,7 +149,7 @@ namespace OpenSim.Services.Connectors.Inventory
149 /// <returns></returns> 149 /// <returns></returns>
150 public InventoryCollection GetFolderContent(string id, UUID folderID, UUID sessionID) 150 public InventoryCollection GetFolderContent(string id, UUID folderID, UUID sessionID)
151 { 151 {
152 m_log.Debug("[HGInventory]: GetSystemFolders " + id); 152 m_log.Debug("[HGInventory]: GetFolderContent " + id);
153 string url = string.Empty; 153 string url = string.Empty;
154 string userID = string.Empty; 154 string userID = string.Empty;
155 155
@@ -279,5 +279,17 @@ namespace OpenSim.Services.Connectors.Inventory
279 return null; 279 return null;
280 } 280 }
281 281
282 public int GetAssetPermissions(string id, UUID assetID, UUID sessionID)
283 {
284 string url = string.Empty;
285 string userID = string.Empty;
286
287 if (StringToUrlAndUserID(id, out url, out userID))
288 {
289 ISessionAuthInventoryService connector = GetConnector(url);
290 return connector.GetAssetPermissions(userID, assetID, sessionID);
291 }
292 return 0;
293 }
282 } 294 }
283} 295}
diff --git a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
index 973cb0a..f50bcf5 100644
--- a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
+++ b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
@@ -120,5 +120,7 @@ namespace OpenSim.Services.Connectors
120 120
121 InventoryFolderBase QueryFolder(string userID, InventoryFolderBase item, UUID session_id); 121 InventoryFolderBase QueryFolder(string userID, InventoryFolderBase item, UUID session_id);
122 122
123 int GetAssetPermissions(string userID, UUID assetID, UUID session_id);
124
123 } 125 }
124} 126}
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
index e41b427..4907015 100644
--- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
@@ -163,21 +163,21 @@ namespace OpenSim.Services.Connectors
163 /// <returns></returns> 163 /// <returns></returns>
164 public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(string userID, UUID sessionID) 164 public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(string userID, UUID sessionID)
165 { 165 {
166 // !!! Not just yet. 166 try
167 //try 167 {
168 //{ 168 List<InventoryFolderBase> folders = SynchronousRestSessionObjectPoster<Guid, List<InventoryFolderBase>>.BeginPostObject(
169 // List<InventoryFolderBase> folders = SynchronousRestSessionObjectPoster<Guid, List<InventoryFolderBase>>.BeginPostObject( 169 "POST", m_ServerURI + "/SystemFolders/", new Guid(userID), sessionID.ToString(), userID.ToString());
170 // "POST", m_ServerURI + "/SystemFolders/", new Guid(userID), sessionID.ToString(), userID.ToString()); 170
171 // Dictionary<AssetType, InventoryFolderBase> dFolders = new Dictionary<AssetType, InventoryFolderBase>(); 171 Dictionary<AssetType, InventoryFolderBase> dFolders = new Dictionary<AssetType, InventoryFolderBase>();
172 // foreach (InventoryFolderBase f in folders) 172 foreach (InventoryFolderBase f in folders)
173 // dFolders[(AssetType)f.Type] = f; 173 dFolders[(AssetType)f.Type] = f;
174 // return dFolders; 174 return dFolders;
175 //} 175 }
176 //catch (Exception e) 176 catch (Exception e)
177 //{ 177 {
178 // m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetSystemFolders operation failed, {0} {1}", 178 m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetSystemFolders operation failed, {0} {1}",
179 // e.Source, e.Message); 179 e.Source, e.Message);
180 //} 180 }
181 181
182 return new Dictionary<AssetType, InventoryFolderBase>(); 182 return new Dictionary<AssetType, InventoryFolderBase>();
183 } 183 }
@@ -348,6 +348,25 @@ namespace OpenSim.Services.Connectors
348 return null; 348 return null;
349 } 349 }
350 350
351 public int GetAssetPermissions(string userID, UUID assetID, UUID sessionID)
352 {
353 try
354 {
355 InventoryItemBase item = new InventoryItemBase();
356 item.Owner = new UUID(userID);
357 item.AssetID = assetID;
358 return SynchronousRestSessionObjectPoster<InventoryItemBase, int>.BeginPostObject(
359 "POST", m_ServerURI + "/AssetPermissions/", item, sessionID.ToString(), userID);
360 }
361 catch (Exception e)
362 {
363 m_log.ErrorFormat("[INVENTORY CONNECTOR]: AssetPermissions operation failed, {0} {1}",
364 e.Source, e.Message);
365 }
366
367 return 0;
368 }
369
351 #endregion 370 #endregion
352 371
353 /// <summary> 372 /// <summary>
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
index 41aacd0..5cbd307 100644
--- a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
@@ -176,5 +176,10 @@ namespace OpenSim.Services.Connectors
176 return null; 176 return null;
177 } 177 }
178 178
179 public int GetAssetPermissions(UUID userID, UUID assetID)
180 {
181 return 0;
182 }
183
179 } 184 }
180} 185}