summaryrefslogtreecommitdiff
path: root/indra/newview/llpreview.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2015-08-17 16:00:04 -0400
committerOz Linden <oz@lindenlab.com>2015-08-17 16:00:04 -0400
commitfe2eefd9139a860cd9ffa67ee5f148ba3922320c (patch)
treed0395a805b44f525a5614bb2b3489d944555c170 /indra/newview/llpreview.cpp
parent4fb66604c9767bf518575963e9d4a871800bdeb3 (diff)
parent1be63209331d509396bd7ee79302d511fe83d72e (diff)
merge changes for 3.8.3-release
Diffstat (limited to 'indra/newview/llpreview.cpp')
-rwxr-xr-xindra/newview/llpreview.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp
index bf2652cb49..fb21b980dc 100755
--- a/indra/newview/llpreview.cpp
+++ b/indra/newview/llpreview.cpp
@@ -49,6 +49,7 @@
#include "llviewerinventory.h"
#include "llviewerwindow.h"
#include "lltrans.h"
+#include "roles_constants.h"
// Constants
@@ -230,8 +231,23 @@ void LLPreview::refreshFromItem()
}
getChild<LLUICtrl>("desc")->setValue(item->getDescription());
- BOOL can_agent_manipulate = item->getPermissions().allowModifyBy(gAgent.getID());
- getChildView("desc")->setEnabled(can_agent_manipulate);
+ getChildView("desc")->setEnabled(canModify(mObjectUUID, item));
+}
+
+// static
+BOOL LLPreview::canModify(const LLUUID taskUUID, const LLInventoryItem* item)
+{
+ if (taskUUID.notNull())
+ {
+ LLViewerObject* object = gObjectList.findObject(taskUUID);
+ if(object && !object->permModify())
+ {
+ // No permission to edit in-world inventory
+ return FALSE;
+ }
+ }
+
+ return item && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE);
}
// static