From f3f7d603675ac15d6397b50591b598aacc932862 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 24 May 2009 16:11:35 +0000 Subject: Add a new permissions check for bulk object returns. --- OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 29a6cd2..731f124 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -79,6 +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); #endregion public class ScenePermissions @@ -135,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes public event CopyUserInventoryHandler OnCopyUserInventory; public event DeleteUserInventoryHandler OnDeleteUserInventory; public event TeleportHandler OnTeleport; + public event UseObjectReturnHandler OnUseObjectReturn; #endregion #region Object Permission Checks @@ -910,5 +912,20 @@ namespace OpenSim.Region.Framework.Scenes } return true; } + + public bool CanUseObjectReturn(ILandObject landData, uint type , IClientAPI client) + { + UseObjectReturnHandler handler = OnUseObjectReturn; + if (handler != null) + { + Delegate[] list = handler.GetInvocationList(); + foreach (UseObjectReturnHandler h in list) + { + if (h(landData, type, client, m_scene) == false) + return false; + } + } + return true; + } } } -- cgit v1.1