diff options
author | cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> | 2023-08-14 09:29:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-14 09:29:58 -0700 |
commit | 50e2973cd2360dedd6baf1c0772d9d009e2628d4 (patch) | |
tree | 71a86030d3d52045642ea1a21168a2effc98e4f6 /indra/newview/llpreview.cpp | |
parent | d8e4572b901b429439f991703f2bc12f81e03901 (diff) | |
parent | 076a02e2d8ddb10856602c3f5f3115ace41327b5 (diff) |
Merge pull request #323 from secondlife/SL-20024
SL-20024: Improve material permissions handling
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); |