Allow export full perm item on opensim if it doesn't support the export bit.

This addresses
https://code.google.com/p/singularity-viewer/issues/detail?id=1003
This commit is contained in:
Aleric Inglewood
2013-08-13 02:31:30 +02:00
parent 11b904af36
commit d7d361004a
9 changed files with 26 additions and 10 deletions

View File

@@ -1099,8 +1099,11 @@ LLPermissions ll_permissions_from_sd(const LLSD& sd_perm)
return rv;
}
bool LLPermissions::allowExportBy(LLUUID const& requester, bool supports_export) const
bool LLPermissions::allowExportBy(LLUUID const& requester, ExportPolicy export_policy) const
{
return !mIsGroupOwned && requester == mOwner && (requester == mCreator || (supports_export && (mMaskEveryone & PERM_EXPORT)));
return !mIsGroupOwned && requester == mOwner && // Must be owner.
(requester == mCreator || // Export is allowed for all export policies when creator.
(export_policy == ep_export_bit && (mMaskEveryone & PERM_EXPORT)) || // If not creator, only allow export when PERM_EXPORT bit is set.
(export_policy == ep_full_perm && (mMaskOwner & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)); // If not creator, only allow export when item is full perm.
}