diff options
author | UbitUmarov | 2017-03-30 17:39:21 +0100 |
---|---|---|
committer | UbitUmarov | 2017-03-30 17:39:21 +0100 |
commit | 9a01fddd1cefea0508b6b1616771e6ef8eabef87 (patch) | |
tree | 2e98a32008bb69965b9be3ef417b56cb60a49e25 /OpenSim/Region/CoreModules/World/Objects | |
parent | mantis 8131: make the new Offline IM code optional and disabled by default, s... (diff) | |
download | opensim-SC-9a01fddd1cefea0508b6b1616771e6ef8eabef87.zip opensim-SC-9a01fddd1cefea0508b6b1616771e6ef8eabef87.tar.gz opensim-SC-9a01fddd1cefea0508b6b1616771e6ef8eabef87.tar.bz2 opensim-SC-9a01fddd1cefea0508b6b1616771e6ef8eabef87.tar.xz |
add CanSellObject() permitions check functions
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Objects')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | 21 |
1 files changed, 8 insertions, 13 deletions
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 | |||
89 | if (part == null) | 89 | if (part == null) |
90 | return; | 90 | return; |
91 | 91 | ||
92 | if (part.ParentGroup.IsDeleted) | 92 | SceneObjectGroup sog = part.ParentGroup; |
93 | if (sog == null || sog.IsDeleted) | ||
93 | return; | 94 | return; |
94 | 95 | ||
95 | if (part.OwnerID != part.GroupID && part.OwnerID != client.AgentId && (!m_scene.Permissions.IsGod(client.AgentId))) | 96 | // Does the user have the power to put the object on sale? |
96 | return; | 97 | if (!m_scene.Permissions.CanSellObject(client, sog, saleType)) |
97 | |||
98 | if (part.OwnerID == part.GroupID) // Group owned | ||
99 | { | 98 | { |
100 | // Does the user have the power to put the object on sale? | 99 | client.SendAgentAlertMessage("You don't have permission to set object on sale", false); |
101 | if (!m_scene.Permissions.CanSellGroupObject(client.AgentId, part.GroupID)) | 100 | return; |
102 | { | ||
103 | client.SendAgentAlertMessage("You don't have permission to set group-owned objects on sale", false); | ||
104 | return; | ||
105 | } | ||
106 | } | 101 | } |
107 | 102 | ||
108 | part = part.ParentGroup.RootPart; | 103 | part = sog.RootPart; |
109 | 104 | ||
110 | part.ObjectSaleType = saleType; | 105 | part.ObjectSaleType = saleType; |
111 | part.SalePrice = salePrice; | 106 | part.SalePrice = salePrice; |
112 | 107 | ||
113 | part.ParentGroup.HasGroupChanged = true; | 108 | sog.HasGroupChanged = true; |
114 | 109 | ||
115 | part.SendPropertiesToClient(client); | 110 | part.SendPropertiesToClient(client); |
116 | } | 111 | } |