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);
|
translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mIsCopyable = false;
|
||||||
// preload the animation
|
// preload the animation
|
||||||
if(item)
|
if(item)
|
||||||
{
|
{
|
||||||
gAgentAvatarp->createMotion(item->getAssetUUID());
|
gAgentAvatarp->createMotion(item->getAssetUUID());
|
||||||
|
|
||||||
const LLPermissions& perm = item->getPermissions();
|
const LLPermissions& perm = item->getPermissions();
|
||||||
U32 mask = PERM_NONE;
|
mIsCopyable = (perm.getCreator() == gAgent.getID());
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ( activate )
|
switch ( activate )
|
||||||
|
|||||||
@@ -79,6 +79,13 @@ LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, cons
|
|||||||
|
|
||||||
const LLInventoryItem* item = getItem();
|
const LLInventoryItem* item = getItem();
|
||||||
|
|
||||||
|
mIsCopyable = false;
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
const LLPermissions& perm = item->getPermissions();
|
||||||
|
mIsCopyable = (perm.getCreator() == gAgent.getID());
|
||||||
|
}
|
||||||
|
|
||||||
childSetCommitCallback("desc", LLPreview::onText, this);
|
childSetCommitCallback("desc", LLPreview::onText, this);
|
||||||
childSetText("desc", item->getDescription());
|
childSetText("desc", item->getDescription());
|
||||||
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
|
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
|
||||||
@@ -293,7 +300,7 @@ void LLPreviewSound::copyUUID( void *userdata )
|
|||||||
// virtual
|
// virtual
|
||||||
BOOL LLPreviewSound::canSaveAs() const
|
BOOL LLPreviewSound::canSaveAs() const
|
||||||
{
|
{
|
||||||
return TRUE;
|
return mIsCopyable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ protected:
|
|||||||
virtual void saveAs();
|
virtual void saveAs();
|
||||||
virtual LLUUID getItemID();
|
virtual LLUUID getItemID();
|
||||||
// </edit>
|
// </edit>
|
||||||
|
private:
|
||||||
|
bool mIsCopyable;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LL_LLPREVIEWSOUND_H
|
#endif // LL_LLPREVIEWSOUND_H
|
||||||
|
|||||||
Reference in New Issue
Block a user