diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/InventoryService/InventoryService.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index 3d706dc..65c2d96 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs | |||
@@ -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> |