Handle PERM_EXPORT in LLPermissions.
This moves all export test code to where it belongs: in LLPermissions. Added LLPermissions::allowExportBy, next to allowModifyBy, allowCopyBy and allowMoveBy. Then changed all code to use this call. Because LLPermissions is part of llinventory, I had to add a proxy for LFSimFeatureHandler. Added a new class LFSimFeatureHandlerInterface that can be used by LLPermissions to check simulator features by accessing the LFSimFeatureHandler singleton. 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). Export rules can now be easily made a function on simulator features. If different rules apply for different types (wearables, objects, mesh etc) then an extra variable indicating the type will have to be passed though.
This commit is contained in:
@@ -2895,15 +2895,7 @@ class LLObjectEnableExport : public view_listener_t
|
||||
const LLSD& userdata;
|
||||
virtual bool apply(LLSelectNode* node)
|
||||
{
|
||||
// Note: the actual permission checking algorithm depends on the grid TOS and must be
|
||||
// performed for each prim and texture. This is done later in llviewerobjectbackup.cpp.
|
||||
// This means that even if the item is enabled in the menu, the export may fail should
|
||||
// the permissions not be met for each exported asset. The permissions check below
|
||||
// therefore only corresponds to the minimal permissions requirement common to all grids.
|
||||
LLPermissions *item_permissions = node->mPermissions;
|
||||
return (gAgent.getID() == item_permissions->getOwner() &&
|
||||
(gAgent.getID() == item_permissions->getCreator() ||
|
||||
(item_permissions->getMaskOwner() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED));
|
||||
return node->mPermissions->allowExportBy(gAgent.getID());
|
||||
}
|
||||
};
|
||||
ff * the_ff = new ff(userdata);
|
||||
|
||||
Reference in New Issue
Block a user