diff options
author | Diva Canto | 2016-06-20 10:08:15 -0700 |
---|---|---|
committer | Diva Canto | 2016-06-20 10:08:15 -0700 |
commit | 359908fa88c4f9188746e87350701750478fbf2f (patch) | |
tree | e15d62226bb52b8cdaf92eb9847ca008bef68f1e /OpenSim/Region/CoreModules/World | |
parent | Mantis #7929: objects deeded to the group were loosing some important propert... (diff) | |
download | opensim-SC_OLD-359908fa88c4f9188746e87350701750478fbf2f.zip opensim-SC_OLD-359908fa88c4f9188746e87350701750478fbf2f.tar.gz opensim-SC_OLD-359908fa88c4f9188746e87350701750478fbf2f.tar.bz2 opensim-SC_OLD-359908fa88c4f9188746e87350701750478fbf2f.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 9 |
2 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index 0e0f05f..42141e4 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -45,8 +45,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BuySellModule")] | 45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BuySellModule")] |
46 | public class BuySellModule : IBuySellModule, INonSharedRegionModule | 46 | public class BuySellModule : IBuySellModule, INonSharedRegionModule |
47 | { | 47 | { |
48 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | protected Scene m_scene = null; | 50 | protected Scene m_scene = null; |
51 | protected IDialogModule m_dialogModule; | 51 | protected IDialogModule m_dialogModule; |
52 | 52 | ||
@@ -92,9 +92,19 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
92 | if (part.ParentGroup.IsDeleted) | 92 | if (part.ParentGroup.IsDeleted) |
93 | return; | 93 | return; |
94 | 94 | ||
95 | if (part.OwnerID != client.AgentId && (!m_scene.Permissions.IsGod(client.AgentId))) | 95 | if (part.OwnerID != part.GroupID && part.OwnerID != client.AgentId && (!m_scene.Permissions.IsGod(client.AgentId))) |
96 | return; | 96 | return; |
97 | 97 | ||
98 | if (part.OwnerID == part.GroupID) // Group owned | ||
99 | { | ||
100 | // Does the user have the power to put the object on sale? | ||
101 | if (!m_scene.Permissions.CanSellGroupObject(client.AgentId, part.GroupID, m_scene)) | ||
102 | { | ||
103 | client.SendAgentAlertMessage("You don't have permission to set group-owned objects on sale", false); | ||
104 | return; | ||
105 | } | ||
106 | } | ||
107 | |||
98 | part = part.ParentGroup.RootPart; | 108 | part = part.ParentGroup.RootPart; |
99 | 109 | ||
100 | part.ObjectSaleType = saleType; | 110 | part.ObjectSaleType = saleType; |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index b57c3d7..c83454e 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -288,6 +288,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
288 | m_scene.Permissions.OnCompileScript += CanCompileScript; | 288 | m_scene.Permissions.OnCompileScript += CanCompileScript; |
289 | m_scene.Permissions.OnSellParcel += CanSellParcel; | 289 | m_scene.Permissions.OnSellParcel += CanSellParcel; |
290 | m_scene.Permissions.OnTakeObject += CanTakeObject; | 290 | m_scene.Permissions.OnTakeObject += CanTakeObject; |
291 | m_scene.Permissions.OnSellGroupObject += CanSellGroupObject; | ||
291 | m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; | 292 | m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; |
292 | m_scene.Permissions.OnTerraformLand += CanTerraformLand; | 293 | m_scene.Permissions.OnTerraformLand += CanTerraformLand; |
293 | m_scene.Permissions.OnLinkObject += CanLinkObject; | 294 | m_scene.Permissions.OnLinkObject += CanLinkObject; |
@@ -1511,6 +1512,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1511 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandSetSale, true); | 1512 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandSetSale, true); |
1512 | } | 1513 | } |
1513 | 1514 | ||
1515 | private bool CanSellGroupObject(UUID userID, UUID groupID, Scene scene) | ||
1516 | { | ||
1517 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | ||
1518 | if (m_bypassPermissions) return m_bypassPermissionsValue; | ||
1519 | |||
1520 | return IsGroupMember(groupID, userID, (ulong)GroupPowers.ObjectSetForSale); | ||
1521 | } | ||
1522 | |||
1514 | private bool CanTakeObject(UUID objectID, UUID stealer, Scene scene) | 1523 | private bool CanTakeObject(UUID objectID, UUID stealer, Scene scene) |
1515 | { | 1524 | { |
1516 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1525 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |