From 76f39d326e88f0793daf5d1f0d19654d596d572c Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 14 Jan 2011 18:26:41 +0100 Subject: [PATCH] Add a new ViewObjectInventory permission to decouple viewing from +MOD status --- .../Framework/Scenes/Scene.Permissions.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index e1fedf4bd0..48beb9c1ab 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -49,6 +49,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene); public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); + public delegate bool ViewObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene); public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List objects, Scene scene); @@ -116,6 +117,7 @@ namespace OpenSim.Region.Framework.Scenes public event DuplicateObjectHandler OnDuplicateObject; public event EditObjectHandler OnEditObject; public event EditObjectInventoryHandler OnEditObjectInventory; + public event ViewObjectInventoryHandler OnViewObjectInventory; public event MoveObjectHandler OnMoveObject; public event ObjectEntryHandler OnObjectEntry; public event ReturnObjectsHandler OnReturnObjects; @@ -401,6 +403,21 @@ namespace OpenSim.Region.Framework.Scenes return true; } + public bool CanViewObjectInventory(UUID objectID, UUID editorID) + { + ViewObjectInventoryHandler handler = OnViewObjectInventory; + if (handler != null) + { + Delegate[] list = handler.GetInvocationList(); + foreach (ViewObjectInventoryHandler h in list) + { + if (h(objectID, editorID, m_scene) == false) + return false; + } + } + return true; + } + #endregion #region MOVE OBJECT