summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorEric M. Tulla (BigPapi) <tulla@lindenlab.com>2009-12-10 16:07:54 -0500
committerEric M. Tulla (BigPapi) <tulla@lindenlab.com>2009-12-10 16:07:54 -0500
commit9db47b1d4bc9c24adf23f862c729464d9422e6a3 (patch)
tree4ff4fe46e228c33350b6fdb594d33eea586fae0c /indra/newview/llinventorybridge.cpp
parentc971462f6e89c7a97d17010fbd74b664b2d9dbb9 (diff)
Fix for EXT-3368 - "Save Texture" functionality was no longer respecting perms
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3746e9cfeb..52ebefabea 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3150,6 +3150,22 @@ void LLTextureBridge::openItem()
}
}
+bool LLTextureBridge::canSaveTexture(void)
+{
+ const LLInventoryModel* model = getInventoryModel();
+ if(!model)
+ {
+ return false;
+ }
+
+ const LLViewerInventoryItem *item = model->getItem(mUUID);
+ if (item)
+ {
+ return item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED);
+ }
+ return false;
+}
+
void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
lldebugs << "LLTextureBridge::buildContextMenu()" << llendl;
@@ -3174,6 +3190,10 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Texture Separator"));
items.push_back(std::string("Save As"));
+ if (!canSaveTexture())
+ {
+ disabled_items.push_back(std::string("Save As"));
+ }
}
hide_context_entries(menu, items, disabled_items);
}