mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
partial mantis 8219; on creating or updating items (animationsets, wearables) that reference assets, and user does not have permissions on those, abort and warn, instead of silent invalition of the references to those assets, creating a broken item
This commit is contained in:
@@ -299,15 +299,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
else if ((CustomInventoryType)item.InvType == CustomInventoryType.AnimationSet)
|
||||
{
|
||||
AnimationSet animSet = new AnimationSet(data);
|
||||
if (!animSet.Validate(x => {
|
||||
uint res = animSet.Validate(x => {
|
||||
const int required = (int)(PermissionMask.Transfer | PermissionMask.Copy);
|
||||
int perms = m_Scene.InventoryService.GetAssetPermissions(remoteClient.AgentId, x);
|
||||
int required = (int)(PermissionMask.Transfer | PermissionMask.Copy);
|
||||
// enforce previus perm rule
|
||||
if ((perms & required) != required)
|
||||
return false;
|
||||
return true;
|
||||
}))
|
||||
return 0;
|
||||
return (uint) perms;
|
||||
});
|
||||
if(res == 0)
|
||||
{
|
||||
data = animSet.ToBytes();
|
||||
remoteClient.SendAgentAlertMessage("Not enought permissions on asset(s) referenced by animation set '{0}', update failed", false);
|
||||
return UUID.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user