diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-08-22 13:18:12 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-08-22 13:18:12 -0500 |
commit | a3a811606088f1b40d9e098ddff8b38a2420b8e9 (patch) | |
tree | 5203dfa631fa87a4563c002ab117f1ae5c5dfbaf /indra/newview/llpreview.cpp | |
parent | 894c9e0417e7b29aaf31c673ca040dff93eb36ef (diff) | |
parent | ef33902f220df35727ba54ee8bc3ed02bc53d6be (diff) |
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/llpreview.cpp')
-rw-r--r-- | indra/newview/llpreview.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index b9b2279e77..0117db86e8 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -241,14 +241,22 @@ void LLPreview::refreshFromItem() // static BOOL LLPreview::canModify(const LLUUID taskUUID, const LLInventoryItem* item) { + const LLViewerObject* object = nullptr; if (taskUUID.notNull()) { - LLViewerObject* object = gObjectList.findObject(taskUUID); - if(object && !object->permModify()) - { - // No permission to edit in-world inventory - return FALSE; - } + object = gObjectList.findObject(taskUUID); + } + + return canModify(object, item); +} + +// static +BOOL LLPreview::canModify(const LLViewerObject* object, const LLInventoryItem* item) +{ + if (object && !object->permModify()) + { + // No permission to edit in-world inventory + return FALSE; } return item && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE); |