summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorEric M. Tulla (BigPapi) <tulla@lindenlab.com>2009-12-09 20:24:37 -0500
committerEric M. Tulla (BigPapi) <tulla@lindenlab.com>2009-12-09 20:24:37 -0500
commit272bb744af3dd942369f4c378db316e182a1ab87 (patch)
treef37089aa216f821b132d46a2a9a1d4a2219508e7 /indra/newview/llpanelmaininventory.cpp
parent6e95fbd3c30cb98ea1b64f1976aef0e681a6fe80 (diff)
Fix for save texture functionality no longer respecting permissions
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 8f71c6f1ee..9d73fbf21a 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -33,6 +33,7 @@
#include "llviewerprecompiledheaders.h"
#include "llpanelmaininventory.h"
+#include "llagent.h"
#include "lldndbutton.h"
#include "llfilepicker.h"
#include "llfloaterinventory.h"
@@ -1017,8 +1018,31 @@ bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata)
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
if (current_item)
{
- LLInventoryType::EType curr_type = current_item->getListener()->getInventoryType();
- return (curr_type == LLInventoryType::IT_TEXTURE || curr_type == LLInventoryType::IT_SNAPSHOT);
+ bool can_save = false;
+ LLInventoryItem *item = gInventory.getItem(current_item->getListener()->getUUID());
+ if(item)
+ {
+ const LLPermissions& perm = item->getPermissions();
+ U32 mask = PERM_NONE;
+ if(perm.getOwner() == gAgent.getID())
+ {
+ mask = perm.getMaskBase();
+ }
+ else if(gAgent.isInGroup(perm.getGroup()))
+ {
+ mask = perm.getMaskGroup();
+ }
+ else
+ {
+ mask = perm.getMaskEveryone();
+ }
+ if((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
+ {
+ can_save = true;
+ }
+ LLInventoryType::EType curr_type = current_item->getListener()->getInventoryType();
+ return can_save && (curr_type == LLInventoryType::IT_TEXTURE || curr_type == LLInventoryType::IT_SNAPSHOT);
+ }
}
return false;
}