Allow the perms module to inspect and modify the list of objects to return
for more fine-grained control0.6.6-post-fixes
parent
c028d0a3c1
commit
ca75c101ec
|
@ -795,9 +795,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
Dictionary<UUID,List<SceneObjectGroup>> returns =
|
Dictionary<UUID,List<SceneObjectGroup>> returns =
|
||||||
new Dictionary<UUID,List<SceneObjectGroup>>();
|
new Dictionary<UUID,List<SceneObjectGroup>>();
|
||||||
|
|
||||||
if (!m_scene.Permissions.CanUseObjectReturn(this, type, remote_client))
|
|
||||||
return;
|
|
||||||
|
|
||||||
lock (primsOverMe)
|
lock (primsOverMe)
|
||||||
{
|
{
|
||||||
if (type == (uint)ObjectReturnType.Owner)
|
if (type == (uint)ObjectReturnType.Owner)
|
||||||
|
@ -859,7 +856,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (List<SceneObjectGroup> ol in returns.Values)
|
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
|
#endregion
|
||||||
|
|
|
@ -1525,7 +1525,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||||
return GenericObjectPermission(agentID, prim, false);
|
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);
|
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
||||||
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID);
|
public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID);
|
||||||
public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID);
|
public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID);
|
||||||
public delegate bool TeleportHandler(UUID userID, Scene scene);
|
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
|
#endregion
|
||||||
|
|
||||||
public class ScenePermissions
|
public class ScenePermissions
|
||||||
|
@ -913,7 +913,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return true;
|
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;
|
UseObjectReturnHandler handler = OnUseObjectReturn;
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
|
@ -921,7 +921,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
Delegate[] list = handler.GetInvocationList();
|
Delegate[] list = handler.GetInvocationList();
|
||||||
foreach (UseObjectReturnHandler h in list)
|
foreach (UseObjectReturnHandler h in list)
|
||||||
{
|
{
|
||||||
if (h(landData, type, client, m_scene) == false)
|
if (h(landData, type, client, retlist, m_scene) == false)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue