summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-26 19:23:42 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-26 19:23:42 +0000
commit213ff5a4e0fa150d91c1a68fb56bb7cb605020d6 (patch)
tree2ac41641567265dee7ccb4c36c5a7873c6b8773d /indra/newview/llviewerinventory.cpp
parent470c05b70808f0a51090c0f50847fe614bf041e9 (diff)
EXT-5820 I can copy asset UUID from non-FULLPERM assets turning on admin mode.
If you're reading this message, this was reviewed by Soft, Nyx or Aura. :)
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 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())