Related to mantis #7929: "For sale" was not being accepted, because of permissions fail. This adds a new permissions check CanSellGroupObject. THIRD-PARTY PERMISSIONS MODULES TAKE NOTE OF THIS NEW EVENT.

This commit is contained in:
Diva Canto
2016-06-20 10:08:15 -07:00
parent 623a2f859f
commit 359908fa88
3 changed files with 53 additions and 3 deletions

View File

@@ -45,8 +45,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BuySellModule")]
public class BuySellModule : IBuySellModule, INonSharedRegionModule
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene m_scene = null;
protected IDialogModule m_dialogModule;
@@ -92,9 +92,19 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
if (part.ParentGroup.IsDeleted)
return;
if (part.OwnerID != client.AgentId && (!m_scene.Permissions.IsGod(client.AgentId)))
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.CanSellGroupObject(client.AgentId, part.GroupID, m_scene))
{
client.SendAgentAlertMessage("You don't have permission to set group-owned objects on sale", false);
return;
}
}
part = part.ParentGroup.RootPart;
part.ObjectSaleType = saleType;