summaryrefslogtreecommitdiff
path: root/indra/newview/llpreview.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-07-24 16:16:52 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-08-11 16:30:59 -0700
commitca6f465088be904fa5b85297396227f905792a3b (patch)
tree13b470566e2af2529b112e044990b9d8c3cae607 /indra/newview/llpreview.cpp
parenta4030031f895f8497e106f0547eb29780d6ec4e9 (diff)
SL-20024: Disable material editor on prim when contained material is no mod
Diffstat (limited to 'indra/newview/llpreview.cpp')
-rw-r--r--indra/newview/llpreview.cpp20
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);