diff options
| author | Rider Linden <rider@lindenlab.com> | 2015-08-25 11:40:36 -0700 |
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2015-08-25 11:40:36 -0700 |
| commit | 96bb17f20bbcdc595f3a615a3129e134595b3a4a (patch) | |
| tree | e51e47f79b78a076e821360763196cc72c154aad /indra/newview/llpreview.cpp | |
| parent | 7c61728b4bae928b2461f0f933dd1c1fa34ef0aa (diff) | |
| parent | 1be63209331d509396bd7ee79302d511fe83d72e (diff) | |
Merge
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 |
