From baf86263e6dc1fe7f964e5885d6bed753554dad7 Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Mon, 4 Nov 2019 18:24:36 +0200
Subject: [PATCH] SL-12213 Unable to paste no-modify/no-transfer texture

---
 indra/newview/llpanelobject.cpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 56aea7db5e6..01fa9cc0748 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -2449,7 +2449,7 @@ bool LLPanelObject::canCopyTexture(LLUUID image_id)
 {
     // User is allowed to copy a texture if:
     // library asset or default texture,
-    // or full perm asset exists in user's inventory
+    // or copy perm asset exists in user's inventory
 
     // Library asset or default texture
     if (gInventory.isObjectDescendentOf(image_id, gInventory.getLibraryRootFolderID())
@@ -2461,7 +2461,7 @@ bool LLPanelObject::canCopyTexture(LLUUID image_id)
         return true;
     }
 
-    // Search for a full perm asset
+    // Search for a copy perm asset
     LLViewerInventoryCategory::cat_array_t cats;
     LLViewerInventoryItem::item_array_t items;
     LLAssetIDMatches asset_id_matches(image_id);
@@ -2475,9 +2475,15 @@ bool LLPanelObject::canCopyTexture(LLUUID image_id)
         for (S32 i = 0; i < items.size(); i++)
         {
             LLViewerInventoryItem* itemp = items[i];
-            if (itemp->getIsFullPerm())
+            if (itemp)
             {
-                return true;
+                LLPermissions item_permissions = itemp->getPermissions();
+                if (item_permissions.allowOperationBy(PERM_COPY,
+                    gAgent.getID(),
+                    gAgent.getGroupID()))
+                {
+                    return true;
+                }
             }
         }
     }
-- 
GitLab