Allow the perms module to inspect and modify the list of objects to return

for more fine-grained control
0.6.6-post-fixes
Melanie Thielker 2009-05-24 17:20:47 +00:00
parent c028d0a3c1
commit ca75c101ec
3 changed files with 8 additions and 8 deletions

View File

@ -795,9 +795,6 @@ namespace OpenSim.Region.CoreModules.World.Land
Dictionary<UUID,List<SceneObjectGroup>> returns =
new Dictionary<UUID,List<SceneObjectGroup>>();
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<SceneObjectGroup> 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

View File

@ -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<SceneObjectGroup> retlist, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;

View File

@ -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<SceneObjectGroup> 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<SceneObjectGroup> 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;
}
}