aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/InventoryService
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/InventoryService')
-rw-r--r--OpenSim/Services/InventoryService/InventoryService.cs27
1 files changed, 25 insertions, 2 deletions
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs
index a9ecda4..65c2d96 100644
--- a/OpenSim/Services/InventoryService/InventoryService.cs
+++ b/OpenSim/Services/InventoryService/InventoryService.cs
@@ -398,7 +398,7 @@ namespace OpenSim.Services.InventoryService
398 return true; 398 return true;
399 } 399 }
400 400
401 public virtual InventoryItemBase QueryItem(InventoryItemBase item) 401 public virtual InventoryItemBase GetItem(InventoryItemBase item)
402 { 402 {
403 InventoryItemBase result = m_Database.queryInventoryItem(item.ID); 403 InventoryItemBase result = m_Database.queryInventoryItem(item.ID);
404 if (result != null) 404 if (result != null)
@@ -407,7 +407,7 @@ namespace OpenSim.Services.InventoryService
407 return null; 407 return null;
408 } 408 }
409 409
410 public virtual InventoryFolderBase QueryFolder(InventoryFolderBase item) 410 public virtual InventoryFolderBase GetFolder(InventoryFolderBase item)
411 { 411 {
412 InventoryFolderBase result = m_Database.queryInventoryFolder(item.ID); 412 InventoryFolderBase result = m_Database.queryInventoryFolder(item.ID);
413 if (result != null) 413 if (result != null)
@@ -465,6 +465,29 @@ namespace OpenSim.Services.InventoryService
465 return null; 465 return null;
466 } 466 }
467 467
468 public int GetAssetPermissions(UUID userID, UUID assetID)
469 {
470 InventoryFolderBase parent = GetRootFolder(userID);
471 return FindAssetPerms(parent, assetID);
472 }
473
474 private int FindAssetPerms(InventoryFolderBase folder, UUID assetID)
475 {
476 InventoryCollection contents = GetFolderContent(folder.Owner, folder.ID);
477
478 int perms = 0;
479 foreach (InventoryItemBase item in contents.Items)
480 {
481 if (item.AssetID == assetID)
482 perms = (int)item.CurrentPermissions | perms;
483 }
484
485 foreach (InventoryFolderBase subfolder in contents.Folders)
486 perms = perms | FindAssetPerms(subfolder, assetID);
487
488 return perms;
489 }
490
468 /// <summary> 491 /// <summary>
469 /// Used to create a new user inventory. 492 /// Used to create a new user inventory.
470 /// </summary> 493 /// </summary>