From 6146e7ef258b10888ad7464b72b75cca701e02c9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 22 Mar 2012 12:57:12 -0700 Subject: Simple build permissions feature. NOTE: EXPERIMENTAL, DISABLED BY DEFAULT. Turns out that this can't be expressed by cascading Permission modules, so I did it as per this patch. --- .../Region/CoreModules/World/Land/LandObject.cs | 41 +++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Land') diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index cc42f7f..640a024 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -169,6 +169,11 @@ namespace OpenSim.Region.CoreModules.World.Land return newLand; } + public ILandObject MemberwiseCopy() + { + return (ILandObject)this.MemberwiseClone(); + } + static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; @@ -242,11 +247,13 @@ namespace OpenSim.Region.CoreModules.World.Land m_lastSeqId = seq_id; } + ILandObject landToSend = this; + m_scene.Permissions.LandObjectForClient(remote_client.AgentId, (ILandObject)this, out landToSend); remote_client.SendLandProperties(seq_id, - snap_selection, request_result, this, - (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, - GetParcelMaxPrimCount(), - GetSimulatorMaxPrimCount(), regionFlags); + snap_selection, request_result, landToSend, + (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, + GetParcelMaxPrimCount(), + GetSimulatorMaxPrimCount(), regionFlags); } public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client) @@ -475,6 +482,32 @@ namespace OpenSim.Region.CoreModules.World.Land return false; } + public bool IsAllowedInLand(UUID avatar) + { + ExpireAccessList(); + + if (m_scene.Permissions.IsAdministrator(avatar)) + return true; + + if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar)) + return true; + + if (avatar == LandData.OwnerID) + return true; + + if (LandData.ParcelAccessList.FindIndex( + delegate(LandAccessEntry e) + { + if (e.AgentID == avatar && e.Flags == AccessList.Access) + return true; + return false; + }) != -1) + { + return true; + } + return false; + } + public void SendLandUpdateToClient(IClientAPI remote_client) { SendLandProperties(0, false, 0, remote_client); -- cgit v1.1