Move export permission check to LLPermissions, try two.

Removes code duplication.

Several parts of the code ignored the PERM_EXPORT but
and still did demand that things are full perm next
to being a creator. This has now changed the export
rules are the same for everything as they were for mesh:
you need to be the owner and the creator for every element
that is exported (not just the root prim, of course).
This commit is contained in:
Aleric Inglewood
2013-07-22 22:38:43 +02:00
parent be6699198f
commit dcf1cdbc4e
8 changed files with 41 additions and 53 deletions

View File

@@ -79,6 +79,7 @@
#include "llviewerwindow.h"
#include "hippogridmanager.h"
#include "lfsimfeaturehandler.h"
#include "llviewerobjectbackup.h"
@@ -398,18 +399,7 @@ void LLObjectBackup::exportObject_continued(AIFilePicker* filepicker)
bool LLObjectBackup::validatePerms(const LLPermissions *item_permissions)
{
if (gHippoGridManager->getConnectedGrid()->isSecondLife())
{
// In Second Life, you must be the creator to be permitted to export the asset.
return (gAgent.getID() == item_permissions->getOwner() &&
gAgent.getID() == item_permissions->getCreator());
}
else
{
// Out of Second Life, simply check that the asset is full perms.
return (gAgent.getID() == item_permissions->getOwner() &&
(item_permissions->getMaskOwner() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED);
}
return item_permissions->allowExportBy(gAgent.getID(), LFSimFeatureHandler::instance().simSupportsExport());
}
// So far, only Second Life forces TPVs to verify the creator for textures...