From 9a01fddd1cefea0508b6b1616771e6ef8eabef87 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 30 Mar 2017 17:39:21 +0100 Subject: add CanSellObject() permitions check functions --- .../World/Objects/BuySell/BuySellModule.cs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Objects') diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index 142c8b7..90d65c7 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs @@ -89,28 +89,23 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell if (part == null) return; - if (part.ParentGroup.IsDeleted) + SceneObjectGroup sog = part.ParentGroup; + if (sog == null || sog.IsDeleted) return; - if (part.OwnerID != part.GroupID && part.OwnerID != client.AgentId && (!m_scene.Permissions.IsGod(client.AgentId))) - return; - - if (part.OwnerID == part.GroupID) // Group owned + // Does the user have the power to put the object on sale? + if (!m_scene.Permissions.CanSellObject(client, sog, saleType)) { - // Does the user have the power to put the object on sale? - if (!m_scene.Permissions.CanSellGroupObject(client.AgentId, part.GroupID)) - { - client.SendAgentAlertMessage("You don't have permission to set group-owned objects on sale", false); - return; - } + client.SendAgentAlertMessage("You don't have permission to set object on sale", false); + return; } - part = part.ParentGroup.RootPart; + part = sog.RootPart; part.ObjectSaleType = saleType; part.SalePrice = salePrice; - part.ParentGroup.HasGroupChanged = true; + sog.HasGroupChanged = true; part.SendPropertiesToClient(client); } -- cgit v1.1