summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-03-27 00:14:56 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-03-27 00:14:56 +0200
commit78174fc8658caeddfd8306ec19eb0e1c2975368e (patch)
tree0948d578f384fbd247eefd2dff771a9cd8cbd8c1 /indra/newview/llselectmgr.cpp
parent689ef9442581d7af8ff0e0264be4919fe6cffd73 (diff)
parent9567393f803dfb0c786b8e917e41c8f4b8b22af7 (diff)
Merge remote-tracking branch 'origin/main' into DRTVWR-588-maint-W
# Conflicts: # .github/workflows/build.yaml
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--indra/newview/llselectmgr.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index a887f9aa9e..b50c0f60bd 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1879,7 +1879,8 @@ bool LLSelectMgr::selectionSetImage(const LLUUID& imageid)
te,
mItem,
LLToolDragAndDrop::SOURCE_AGENT,
- LLUUID::null);
+ LLUUID::null,
+ false);
}
else // not an inventory item
{
@@ -1959,26 +1960,30 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
{
return false;
}
- if (mItem && objectp->isAttachment())
+ LLUUID asset_id = mMatId;
+ if (mItem)
{
const LLPermissions& perm = mItem->getPermissions();
- BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE;
- if (!unrestricted)
+ bool from_library = perm.getOwner() == ALEXANDRIA_LINDEN_ID;
+ if (objectp->isAttachment())
{
- // Attachments are in world and in inventory simultaneously,
- // at the moment server doesn't support such a situation.
- return false;
+ bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
+
+ if (!unrestricted && !from_library)
+ {
+ // Attachments are in world and in inventory simultaneously,
+ // at the moment server doesn't support such a situation.
+ return false;
+ }
}
- }
- LLUUID asset_id = mMatId;
- if (mItem)
- {
- // If success, the material may be copied into the object's inventory
- BOOL success = LLToolDragAndDrop::handleDropMaterialProtections(objectp, mItem, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null);
- if (!success)
+
+ if (!from_library
+ // Check if item may be copied into the object's inventory
+ && !LLToolDragAndDrop::handleDropMaterialProtections(objectp, mItem, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null))
{
return false;
}
+
asset_id = mItem->getAssetUUID();
if (asset_id.isNull())
{
@@ -1994,11 +1999,13 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
};
bool success = true;
- if (item &&
- (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()) ||
+ if (item
+ && (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()) ||
!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()) ||
!item->getPermissions().allowOperationBy(PERM_MODIFY, gAgent.getID())
- ))
+ )
+ && item->getPermissions().getOwner() != ALEXANDRIA_LINDEN_ID
+ )
{
success = success && getSelection()->applyRestrictedPbrMaterialToTEs(item);
}