More reliable preview perm checks
This commit is contained in:
@@ -73,29 +73,14 @@ LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const
|
||||
translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop);
|
||||
}
|
||||
|
||||
mIsCopyable = false;
|
||||
// preload the animation
|
||||
if(item)
|
||||
{
|
||||
gAgentAvatarp->createMotion(item->getAssetUUID());
|
||||
|
||||
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)
|
||||
{
|
||||
mIsCopyable = true;
|
||||
}
|
||||
mIsCopyable = (perm.getCreator() == gAgent.getID());
|
||||
}
|
||||
|
||||
switch ( activate )
|
||||
|
||||
@@ -78,6 +78,13 @@ LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, cons
|
||||
button->setSoundFlags(LLView::SILENT);
|
||||
|
||||
const LLInventoryItem* item = getItem();
|
||||
|
||||
mIsCopyable = false;
|
||||
if(item)
|
||||
{
|
||||
const LLPermissions& perm = item->getPermissions();
|
||||
mIsCopyable = (perm.getCreator() == gAgent.getID());
|
||||
}
|
||||
|
||||
childSetCommitCallback("desc", LLPreview::onText, this);
|
||||
childSetText("desc", item->getDescription());
|
||||
@@ -293,7 +300,7 @@ void LLPreviewSound::copyUUID( void *userdata )
|
||||
// virtual
|
||||
BOOL LLPreviewSound::canSaveAs() const
|
||||
{
|
||||
return TRUE;
|
||||
return mIsCopyable;
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
||||
@@ -71,7 +71,8 @@ protected:
|
||||
virtual void saveAs();
|
||||
virtual LLUUID getItemID();
|
||||
// </edit>
|
||||
|
||||
private:
|
||||
bool mIsCopyable;
|
||||
};
|
||||
|
||||
#endif // LL_LLPREVIEWSOUND_H
|
||||
|
||||
Reference in New Issue
Block a user