summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-03-01 18:09:04 -0800
committerRoxie Linden <roxie@lindenlab.com>2010-03-01 18:09:04 -0800
commit1147cb1afbc21e1251614895844e95bca9b6b5bc (patch)
treeda01f6c0e6b61a7c0637a371c946ea69b46f9dff /indra/newview/llviewerinventory.cpp
parentb11a625e6ff89470d25273fa426ed13f7abc4a6a (diff)
parent0600083891ab5b2c6a79097f65945bcb2d049bed (diff)
Automated merge from trunk
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r--indra/newview/llviewerinventory.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index af32d035d7..bc69e96ca5 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1168,6 +1168,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())