diff options
author | Dave Parks <davep@lindenlab.com> | 2010-03-01 15:25:35 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-03-01 15:25:35 -0600 |
commit | 99b0d17833a8a2efab9c08edf2ada3718736a5ba (patch) | |
tree | 8951e7aabe026917d299436ebc28019f9966cd02 /indra/newview/llviewerinventory.cpp | |
parent | 746037362ed07af0c799caf22cf9e425744359a0 (diff) | |
parent | 7564813d608f79e6fc70e1f58a861c640d1b6fa2 (diff) |
Merge with viewer-2-0
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b69eaa4853..f02e854db6 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1165,6 +1165,40 @@ const LLUUID& LLViewerInventoryItem::getAssetUUID() const return LLInventoryItem::getAssetUUID(); } +const LLUUID& LLViewerInventoryItem::getProtectedAssetUUID() const +{ + if (const LLViewerInventoryItem *linked_item = getLinkedItem()) + { + return linked_item->getProtectedAssetUUID(); + } + + // check for conditions under which we may return a visible UUID to the user + bool item_is_fullperm = getIsFullPerm(); + bool agent_is_godlike = gAgent.isGodlikeWithoutAdminMenuFakery(); + if (item_is_fullperm || agent_is_godlike) + { + return LLInventoryItem::getAssetUUID(); + } + + return LLUUID::null; +} + +const bool LLViewerInventoryItem::getIsFullPerm() const +{ + LLPermissions item_permissions = getPermissions(); + + // modify-ok & copy-ok & transfer-ok + return ( item_permissions.allowOperationBy(PERM_MODIFY, + gAgent.getID(), + gAgent.getGroupID()) && + item_permissions.allowOperationBy(PERM_COPY, + gAgent.getID(), + gAgent.getGroupID()) && + item_permissions.allowOperationBy(PERM_TRANSFER, + gAgent.getID(), + gAgent.getGroupID()) ); +} + const std::string& LLViewerInventoryItem::getName() const { if (const LLViewerInventoryItem *linked_item = getLinkedItem()) |