From 88aefc95eace0bb8ea21cb44514d41d98bdf74cc Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 30 Nov 2023 17:47:46 +0200 Subject: SL-20655 FIXED Texture permissions not enforced in Material floaters --- indra/newview/llmaterialeditor.cpp | 8 ++++---- indra/newview/llpanelface.cpp | 3 +-- indra/newview/lltexturectrl.cpp | 6 ++++++ indra/newview/lltexturectrl.h | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 70e21cae73..292ddb765f 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -436,10 +436,10 @@ BOOL LLMaterialEditor::postBuild() if (!gAgent.isGodlike()) { // Only allow fully permissive textures - mBaseColorTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); - mMetallicTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); - mEmissiveTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); - mNormalTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); + mBaseColorTextureCtrl->setFilterPermissionMasks(PERM_COPY | PERM_TRANSFER); + mMetallicTextureCtrl->setFilterPermissionMasks(PERM_COPY | PERM_TRANSFER); + mEmissiveTextureCtrl->setFilterPermissionMasks(PERM_COPY | PERM_TRANSFER); + mNormalTextureCtrl->setFilterPermissionMasks(PERM_COPY | PERM_TRANSFER); } // Texture callback diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index e7b856f743..ffcc4be290 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1980,8 +1980,7 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, if (objectp->isAttachment()) { - pbr_ctrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER | PERM_MODIFY); - pbr_ctrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER | PERM_MODIFY); + pbr_ctrl->setFilterPermissionMasks(PERM_COPY | PERM_TRANSFER | PERM_MODIFY); } else { diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index f302426a43..28e01c6c21 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1715,6 +1715,12 @@ void LLTextureCtrl::setImmediateFilterPermMask(PermissionMask mask) } } +void LLTextureCtrl::setFilterPermissionMasks(PermissionMask mask) +{ + setImmediateFilterPermMask(mask); + setDnDFilterPermMask(mask); +} + void LLTextureCtrl::setVisible( BOOL visible ) { if( !visible ) diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index c47df5accb..7a96eea60d 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -196,6 +196,7 @@ public: void setDnDFilterPermMask(PermissionMask mask) { mDnDFilterPermMask = mask; } PermissionMask getImmediateFilterPermMask() { return mImmediateFilterPermMask; } + void setFilterPermissionMasks(PermissionMask mask); void closeDependentFloater(); -- cgit v1.2.3