From ca75c101ecf908bdbf6a7993082d77ae6ed9518c Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 24 May 2009 17:20:47 +0000 Subject: Allow the perms module to inspect and modify the list of objects to return for more fine-grained control --- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 8 ++++---- OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index ccb3a47..414d1a5 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -795,9 +795,6 @@ namespace OpenSim.Region.CoreModules.World.Land Dictionary> returns = new Dictionary>(); - if (!m_scene.Permissions.CanUseObjectReturn(this, type, remote_client)) - return; - lock (primsOverMe) { if (type == (uint)ObjectReturnType.Owner) @@ -859,7 +856,10 @@ namespace OpenSim.Region.CoreModules.World.Land } foreach (List ol in returns.Values) - m_scene.returnObjects(ol.ToArray(), remote_client.AgentId); + { + if (m_scene.Permissions.CanUseObjectReturn(this, type, remote_client, ol)) + m_scene.returnObjects(ol.ToArray(), remote_client.AgentId); + } } #endregion diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 33b9288..ff57192 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1525,7 +1525,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return GenericObjectPermission(agentID, prim, false); } - private bool CanUseObjectReturn(ILandObject parcel, uint type, IClientAPI client, Scene scene) + private bool CanUseObjectReturn(ILandObject parcel, uint type, IClientAPI client, List retlist, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 731f124..b6f3fee 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -79,7 +79,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID); public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); public delegate bool TeleportHandler(UUID userID, Scene scene); - public delegate bool UseObjectReturnHandler(ILandObject landData, uint type, IClientAPI client, Scene scene); + public delegate bool UseObjectReturnHandler(ILandObject landData, uint type, IClientAPI client, List retlist, Scene scene); #endregion public class ScenePermissions @@ -913,7 +913,7 @@ namespace OpenSim.Region.Framework.Scenes return true; } - public bool CanUseObjectReturn(ILandObject landData, uint type , IClientAPI client) + public bool CanUseObjectReturn(ILandObject landData, uint type , IClientAPI client, List retlist) { UseObjectReturnHandler handler = OnUseObjectReturn; if (handler != null) @@ -921,7 +921,7 @@ namespace OpenSim.Region.Framework.Scenes Delegate[] list = handler.GetInvocationList(); foreach (UseObjectReturnHandler h in list) { - if (h(landData, type, client, m_scene) == false) + if (h(landData, type, client, retlist, m_scene) == false) return false; } } -- cgit v1.1