diff options
| author | Oz Linden <oz@lindenlab.com> | 2015-08-17 16:00:04 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2015-08-17 16:00:04 -0400 |
| commit | fe2eefd9139a860cd9ffa67ee5f148ba3922320c (patch) | |
| tree | d0395a805b44f525a5614bb2b3489d944555c170 /indra/newview/llpreview.cpp | |
| parent | 4fb66604c9767bf518575963e9d4a871800bdeb3 (diff) | |
| parent | 1be63209331d509396bd7ee79302d511fe83d72e (diff) | |
merge changes for 3.8.3-release
Diffstat (limited to 'indra/newview/llpreview.cpp')
| -rwxr-xr-x | indra/newview/llpreview.cpp | 20 |
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 |
