diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-09-19 00:54:14 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-09-19 01:01:43 +0300 |
commit | 97ee8b207bf43a8acb3f2702d26eb5f3b7471e45 (patch) | |
tree | 392b0e915c9bbc4f98539b7fed8f7bcbcf480308 /indra/newview/llpanelvolume.cpp | |
parent | f479c54fbf4a2264f705f153dd944b637eaa860a (diff) |
SL-5522 Fix applying textuers and materials with limited restrictions to attachments
1. Texture picker now updates filter's permissions based on selection
2. Various panels now properly check permissions
Diffstat (limited to 'indra/newview/llpanelvolume.cpp')
-rw-r--r-- | indra/newview/llpanelvolume.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index ed244f773c..d6c36bbfb7 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -365,6 +365,15 @@ void LLPanelVolume::getState( ) { LightTextureCtrl->setEnabled(FALSE); LightTextureCtrl->setValid(FALSE); + + if (objectp->isAttachment()) + { + LightTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); + } + else + { + LightTextureCtrl->setImmediateFilterPermMask(PERM_NONE); + } } getChildView("Light Intensity")->setEnabled(false); @@ -1409,6 +1418,19 @@ void LLPanelVolume::setLightTextureID(const LLUUID &asset_id, const LLUUID &item if (volobjp) { LLViewerInventoryItem* item = gInventory.getItem(item_id); + + if (item && volobjp->isAttachment()) + { + const LLPermissions& perm = item->getPermissions(); + BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; + if (!unrestricted) + { + // Attachments are in world and in inventory simultaneously, + // at the moment server doesn't support such a situation. + return; + } + } + if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())) { LLToolDragAndDrop::handleDropMaterialProtections(volobjp, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null); |