aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Objects
diff options
context:
space:
mode:
authorUbitUmarov2017-03-30 17:39:21 +0100
committerUbitUmarov2017-03-30 17:39:21 +0100
commit9a01fddd1cefea0508b6b1616771e6ef8eabef87 (patch)
tree2e98a32008bb69965b9be3ef417b56cb60a49e25 /OpenSim/Region/CoreModules/World/Objects
parentmantis 8131: make the new Offline IM code optional and disabled by default, s... (diff)
downloadopensim-SC_OLD-9a01fddd1cefea0508b6b1616771e6ef8eabef87.zip
opensim-SC_OLD-9a01fddd1cefea0508b6b1616771e6ef8eabef87.tar.gz
opensim-SC_OLD-9a01fddd1cefea0508b6b1616771e6ef8eabef87.tar.bz2
opensim-SC_OLD-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.cs21
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 }