From 06930a180360e4ec54d8bf44c80794edb0a5a17c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 15 Feb 2019 01:10:56 +0000 Subject: don't break permitions on god object return or delete --- .../Framework/InventoryAccess/InventoryAccessModule.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index d6c65a1..69c1e4e 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -526,16 +526,23 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess item.AssetType = (int)AssetType.Object; item.AssetID = asset.FullID; - if (DeRezAction.SaveToExistingUserInventoryItem == action) + if (action == DeRezAction.SaveToExistingUserInventoryItem) { m_Scene.InventoryService.UpdateItem(item); } else { - AddPermissions(item, objlist[0], objlist, remoteClient); + bool isowner = remoteClient != null && item.Owner == remoteClient.AgentId; + if(action == DeRezAction.Return) + AddPermissions(item, objlist[0], objlist, null); + else if(action == DeRezAction.Delete && !isowner) + AddPermissions(item, objlist[0], objlist, null); + else + AddPermissions(item, objlist[0], objlist, remoteClient); + m_Scene.AddInventoryItem(item); - if (remoteClient != null && item.Owner == remoteClient.AgentId) + if (isowner) { remoteClient.SendInventoryItemCreateUpdate(item, 0); } @@ -1010,7 +1017,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1); rootPart.ParentGroup.ResumeScripts(); - group.ScheduleGroupForFullUpdate(); + group.ScheduleGroupForFullAnimUpdate(); } else m_Scene.AddNewSceneObject(group, true, false); -- cgit v1.1