* Refactor: Break out permissions code into a separate region PermissionsModule
parent
60a83574f4
commit
9655cf2807
|
@ -36,12 +36,12 @@ namespace OpenSim.Grid.ScriptServer
|
||||||
{
|
{
|
||||||
public class FakeScene: Scene
|
public class FakeScene: Scene
|
||||||
{
|
{
|
||||||
public FakeScene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager,
|
public FakeScene(RegionInfo regInfo, AgentCircuitManager authen,
|
||||||
CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
|
CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
|
||||||
AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
|
AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
|
||||||
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool sendTasksToChild)
|
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool sendTasksToChild)
|
||||||
: base(
|
: base(
|
||||||
regInfo, authen, permissionManager, commsMan, sceneGridService, assetCach, storeManager, httpServer,
|
regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, httpServer,
|
||||||
moduleLoader, dumpAssetsToFile, physicalPrim, sendTasksToChild)
|
moduleLoader, dumpAssetsToFile, physicalPrim, sendTasksToChild)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,6 @@ namespace OpenSim
|
||||||
protected List<RegionInfo> m_regionData = new List<RegionInfo>();
|
protected List<RegionInfo> m_regionData = new List<RegionInfo>();
|
||||||
|
|
||||||
protected bool m_physicalPrim;
|
protected bool m_physicalPrim;
|
||||||
protected bool m_permissions = false;
|
|
||||||
|
|
||||||
protected bool m_standaloneAuthenticate = false;
|
protected bool m_standaloneAuthenticate = false;
|
||||||
protected string m_standaloneWelcomeMessage = null;
|
protected string m_standaloneWelcomeMessage = null;
|
||||||
|
@ -264,8 +263,6 @@ namespace OpenSim
|
||||||
|
|
||||||
m_see_into_region_from_neighbor = startupConfig.GetBoolean("see_into_this_sim_from_neighbor", true);
|
m_see_into_region_from_neighbor = startupConfig.GetBoolean("see_into_this_sim_from_neighbor", true);
|
||||||
|
|
||||||
m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false);
|
|
||||||
|
|
||||||
m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.Data.SQLite.dll");
|
m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.Data.SQLite.dll");
|
||||||
if (m_storageDll == "OpenSim.DataStore.MonoSqlite.dll")
|
if (m_storageDll == "OpenSim.DataStore.MonoSqlite.dll")
|
||||||
{
|
{
|
||||||
|
@ -490,7 +487,7 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
|
|
||||||
IClientNetworkServer clientServer;
|
IClientNetworkServer clientServer;
|
||||||
Scene scene = SetupScene(regionInfo, proxyOffset, out clientServer, m_permissions);
|
Scene scene = SetupScene(regionInfo, proxyOffset, out clientServer);
|
||||||
|
|
||||||
m_log.Info("[MODULES]: Loading Region's modules");
|
m_log.Info("[MODULES]: Loading Region's modules");
|
||||||
|
|
||||||
|
@ -531,9 +528,6 @@ namespace OpenSim
|
||||||
scene.CreateTerrainTexture(true);
|
scene.CreateTerrainTexture(true);
|
||||||
scene.RegisterRegionWithGrid();
|
scene.RegisterRegionWithGrid();
|
||||||
|
|
||||||
//Server side object editing permissions checking
|
|
||||||
scene.PermissionsMngr.BypassPermissions = !m_permissions;
|
|
||||||
|
|
||||||
// We need to do this after we've initialized the scripting engines.
|
// We need to do this after we've initialized the scripting engines.
|
||||||
scene.StartScripts();
|
scene.StartScripts();
|
||||||
|
|
||||||
|
@ -565,10 +559,9 @@ namespace OpenSim
|
||||||
protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
|
protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
|
||||||
AgentCircuitManager circuitManager)
|
AgentCircuitManager circuitManager)
|
||||||
{
|
{
|
||||||
PermissionManager permissionManager = new PermissionManager();
|
|
||||||
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
|
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
|
||||||
return
|
return
|
||||||
new Scene(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache,
|
new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache,
|
||||||
storageManager, m_httpServer,
|
storageManager, m_httpServer,
|
||||||
m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_see_into_region_from_neighbor);
|
m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_see_into_region_from_neighbor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4956,13 +4956,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
case "getinfo":
|
case "getinfo":
|
||||||
|
|
||||||
if (((Scene)m_scene).PermissionsMngr.GenericEstatePermission(this.AgentId))
|
if (((Scene)m_scene).Permissions.GenericEstatePermission(this.AgentId))
|
||||||
{
|
{
|
||||||
OnDetailedEstateDataRequest(this, messagePacket.MethodData.Invoice);
|
OnDetailedEstateDataRequest(this, messagePacket.MethodData.Invoice);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "setregioninfo":
|
case "setregioninfo":
|
||||||
if (((Scene)m_scene).PermissionsMngr.CanEditEstateTerrain(this.AgentId))
|
if (((Scene)m_scene).Permissions.CanEditEstateTerrain(this.AgentId))
|
||||||
{
|
{
|
||||||
OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter),convertParamStringToBool(messagePacket.ParamList[1].Parameter),
|
OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter),convertParamStringToBool(messagePacket.ParamList[1].Parameter),
|
||||||
convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter),
|
convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter),
|
||||||
|
@ -4975,7 +4975,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "texturebase":
|
case "texturebase":
|
||||||
if (((Scene)m_scene).PermissionsMngr.CanEditEstateTerrain(this.AgentId))
|
if (((Scene)m_scene).Permissions.CanEditEstateTerrain(this.AgentId))
|
||||||
{
|
{
|
||||||
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
||||||
{
|
{
|
||||||
|
@ -4990,7 +4990,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "texturedetail":
|
case "texturedetail":
|
||||||
if (((Scene)m_scene).PermissionsMngr.CanEditEstateTerrain(this.AgentId))
|
if (((Scene)m_scene).Permissions.CanEditEstateTerrain(this.AgentId))
|
||||||
{
|
{
|
||||||
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
||||||
{
|
{
|
||||||
|
@ -5008,7 +5008,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "textureheights":
|
case "textureheights":
|
||||||
if (((Scene)m_scene).PermissionsMngr.CanEditEstateTerrain(this.AgentId))
|
if (((Scene)m_scene).Permissions.CanEditEstateTerrain(this.AgentId))
|
||||||
{
|
{
|
||||||
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
||||||
{
|
{
|
||||||
|
@ -5029,7 +5029,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
OnCommitEstateTerrainTextureRequest(this);
|
OnCommitEstateTerrainTextureRequest(this);
|
||||||
break;
|
break;
|
||||||
case "setregionterrain":
|
case "setregionterrain":
|
||||||
if (((Scene)m_scene).PermissionsMngr.CanEditEstateTerrain(this.AgentId))
|
if (((Scene)m_scene).Permissions.CanEditEstateTerrain(this.AgentId))
|
||||||
{
|
{
|
||||||
if (messagePacket.ParamList.Length != 9)
|
if (messagePacket.ParamList.Length != 9)
|
||||||
{
|
{
|
||||||
|
@ -5064,7 +5064,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "restart":
|
case "restart":
|
||||||
if (((Scene)m_scene).PermissionsMngr.CanRestartSim(this.AgentId))
|
if (((Scene)m_scene).Permissions.CanRestartSim(this.AgentId))
|
||||||
{
|
{
|
||||||
// There's only 1 block in the estateResetSim.. and that's the number of seconds till restart.
|
// There's only 1 block in the estateResetSim.. and that's the number of seconds till restart.
|
||||||
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
||||||
|
@ -5078,7 +5078,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "estatechangecovenantid":
|
case "estatechangecovenantid":
|
||||||
if (((Scene)m_scene).PermissionsMngr.CanEditEstateTerrain(this.AgentId))
|
if (((Scene)m_scene).Permissions.CanEditEstateTerrain(this.AgentId))
|
||||||
{
|
{
|
||||||
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
||||||
{
|
{
|
||||||
|
@ -5088,7 +5088,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "estateaccessdelta": // Estate access delta manages the banlist and allow list too.
|
case "estateaccessdelta": // Estate access delta manages the banlist and allow list too.
|
||||||
if (((Scene)m_scene).PermissionsMngr.GenericEstatePermission(this.AgentId))
|
if (((Scene)m_scene).Permissions.GenericEstatePermission(this.AgentId))
|
||||||
{
|
{
|
||||||
int estateAccessType = Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter));
|
int estateAccessType = Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter));
|
||||||
OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice,estateAccessType,new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)));
|
OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice,estateAccessType,new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)));
|
||||||
|
@ -5096,7 +5096,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "simulatormessage":
|
case "simulatormessage":
|
||||||
if (((Scene)m_scene).PermissionsMngr.GenericEstatePermission(this.AgentId))
|
if (((Scene)m_scene).Permissions.GenericEstatePermission(this.AgentId))
|
||||||
{
|
{
|
||||||
LLUUID invoice = messagePacket.MethodData.Invoice;
|
LLUUID invoice = messagePacket.MethodData.Invoice;
|
||||||
LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter));
|
LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter));
|
||||||
|
@ -5107,7 +5107,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "instantmessage":
|
case "instantmessage":
|
||||||
if (((Scene)m_scene).PermissionsMngr.GenericEstatePermission(this.AgentId))
|
if (((Scene)m_scene).Permissions.GenericEstatePermission(this.AgentId))
|
||||||
{
|
{
|
||||||
LLUUID invoice = messagePacket.MethodData.Invoice;
|
LLUUID invoice = messagePacket.MethodData.Invoice;
|
||||||
LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter));
|
LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter));
|
||||||
|
@ -5118,7 +5118,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "setregiondebug":
|
case "setregiondebug":
|
||||||
if (((Scene)m_scene).PermissionsMngr.GenericEstatePermission(this.AgentId))
|
if (((Scene)m_scene).Permissions.GenericEstatePermission(this.AgentId))
|
||||||
{
|
{
|
||||||
LLUUID invoice = messagePacket.MethodData.Invoice;
|
LLUUID invoice = messagePacket.MethodData.Invoice;
|
||||||
LLUUID SenderID = messagePacket.AgentData.AgentID;
|
LLUUID SenderID = messagePacket.AgentData.AgentID;
|
||||||
|
@ -5130,7 +5130,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "teleporthomeuser":
|
case "teleporthomeuser":
|
||||||
if (((Scene)m_scene).PermissionsMngr.GenericEstatePermission(this.AgentId))
|
if (((Scene)m_scene).Permissions.GenericEstatePermission(this.AgentId))
|
||||||
{
|
{
|
||||||
LLUUID invoice = messagePacket.MethodData.Invoice;
|
LLUUID invoice = messagePacket.MethodData.Invoice;
|
||||||
LLUUID SenderID = messagePacket.AgentData.AgentID;
|
LLUUID SenderID = messagePacket.AgentData.AgentID;
|
||||||
|
|
|
@ -107,12 +107,12 @@ namespace OpenSim.Region.ClientStack
|
||||||
return physicsPluginManager.GetPhysicsScene(engine, meshEngine);
|
return physicsPluginManager.GetPhysicsScene(engine, meshEngine);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer clientServer, bool m_permissions)
|
protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer clientServer)
|
||||||
{
|
{
|
||||||
return SetupScene(regionInfo, 0, out clientServer, m_permissions);
|
return SetupScene(regionInfo, 0, out clientServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, out IClientNetworkServer clientServer, bool m_permissions)
|
protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, out IClientNetworkServer clientServer)
|
||||||
{
|
{
|
||||||
AgentCircuitManager circuitManager = new AgentCircuitManager();
|
AgentCircuitManager circuitManager = new AgentCircuitManager();
|
||||||
IPAddress listenIP = regionInfo.InternalEndPoint.Address;
|
IPAddress listenIP = regionInfo.InternalEndPoint.Address;
|
||||||
|
@ -162,8 +162,9 @@ namespace OpenSim.Region.ClientStack
|
||||||
scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero;
|
scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
scene.LoadPrimsFromStorage(m_permissions, regionInfo.originRegionID);
|
scene.LoadPrimsFromStorage(regionInfo.originRegionID);
|
||||||
scene.StartTimer();
|
scene.StartTimer();
|
||||||
|
|
||||||
return scene;
|
return scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSim Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using libsecondlife;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.Environment.Interfaces
|
||||||
|
{
|
||||||
|
public interface IScenePermissions
|
||||||
|
{
|
||||||
|
bool BypassPermissions { get; set; }
|
||||||
|
|
||||||
|
#region Object Permissions
|
||||||
|
|
||||||
|
bool CanRezObject(LLUUID user, LLVector3 position);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Permissions check - can user delete an object?
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user">User attempting the delete</param>
|
||||||
|
/// <param name="obj">Target object</param>
|
||||||
|
/// <returns>Has permission?</returns>
|
||||||
|
bool CanDeRezObject(LLUUID user, LLUUID obj);
|
||||||
|
|
||||||
|
bool CanCopyObject(LLUUID user, LLUUID obj);
|
||||||
|
|
||||||
|
bool CanEditObject(LLUUID user, LLUUID obj);
|
||||||
|
|
||||||
|
bool CanEditObjectPosition(LLUUID user, LLUUID obj);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Permissions check - can user enter an object?
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user">User attempting move an object</param>
|
||||||
|
/// <param name="oldPos">Source object-position</param>
|
||||||
|
/// <param name="newPos">Target object-position</param>
|
||||||
|
/// <returns>Has permission?</returns>
|
||||||
|
bool CanObjectEntry(LLUUID user, LLVector3 oldPos, LLVector3 newPos);
|
||||||
|
|
||||||
|
bool CanReturnObject(LLUUID user, LLUUID obj);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Uncategorized permissions
|
||||||
|
|
||||||
|
bool CanInstantMessage(LLUUID user, LLUUID target);
|
||||||
|
|
||||||
|
bool CanInventoryTransfer(LLUUID user, LLUUID target);
|
||||||
|
|
||||||
|
bool CanEditScript(LLUUID user, LLUUID script);
|
||||||
|
|
||||||
|
bool CanRunScript(LLUUID user, LLUUID script);
|
||||||
|
|
||||||
|
bool CanRunConsoleCommand(LLUUID user);
|
||||||
|
|
||||||
|
bool CanTerraform(LLUUID user, LLVector3 position);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Estate Permissions
|
||||||
|
|
||||||
|
bool IsEstateManager(LLUUID user);
|
||||||
|
|
||||||
|
bool GenericEstatePermission(LLUUID user);
|
||||||
|
|
||||||
|
bool CanEditEstateTerrain(LLUUID user);
|
||||||
|
|
||||||
|
bool CanRestartSim(LLUUID user);
|
||||||
|
|
||||||
|
bool CanEditParcel(LLUUID user, ILandObject parcel);
|
||||||
|
|
||||||
|
bool CanSellParcel(LLUUID user, ILandObject parcel);
|
||||||
|
|
||||||
|
bool CanAbandonParcel(LLUUID user, ILandObject parcel);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
uint GenerateClientFlags(LLUUID user, LLUUID objID);
|
||||||
|
}
|
||||||
|
}
|
|
@ -41,10 +41,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
|
||||||
public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>();
|
public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>();
|
||||||
public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
|
public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
|
||||||
|
|
||||||
public XferModule()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#region IRegionModule Members
|
#region IRegionModule Members
|
||||||
|
|
||||||
public void Initialise(Scene scene, IConfigSource config)
|
public void Initialise(Scene scene, IConfigSource config)
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
|
||||||
|
|
||||||
// This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml
|
// This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml
|
||||||
// So make sure you really trust your region owners. because they can add other estate manaagers to your other estates
|
// So make sure you really trust your region owners. because they can add other estate manaagers to your other estates
|
||||||
if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.PermissionsMngr.BypassPermissions)
|
if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.Permissions.BypassPermissions)
|
||||||
{
|
{
|
||||||
m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
|
m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
|
||||||
remote_client.sendEstateManagersList(invoice);
|
remote_client.sendEstateManagersList(invoice);
|
||||||
|
@ -219,7 +219,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
|
||||||
case 512:
|
case 512:
|
||||||
// This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml
|
// This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml
|
||||||
// So make sure you really trust your region owners. because they can add other estate manaagers to your other estates
|
// So make sure you really trust your region owners. because they can add other estate manaagers to your other estates
|
||||||
if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.PermissionsMngr.BypassPermissions)
|
if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.Permissions.BypassPermissions)
|
||||||
{
|
{
|
||||||
m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
|
m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
|
||||||
remote_client.sendEstateManagersList(invoice);
|
remote_client.sendEstateManagersList(invoice);
|
||||||
|
|
|
@ -26,12 +26,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
using Nini.Config;
|
||||||
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment
|
namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||||
{
|
{
|
||||||
public class PermissionManager
|
public class PermissionsModule : IRegionModule, IScenePermissions
|
||||||
{
|
{
|
||||||
protected Scene m_scene;
|
protected Scene m_scene;
|
||||||
|
|
||||||
|
@ -43,11 +45,9 @@ namespace OpenSim.Region.Environment
|
||||||
private uint PERM_MOVE = (uint)524288;
|
private uint PERM_MOVE = (uint)524288;
|
||||||
//private uint PERM_TRANS = (uint)8192;
|
//private uint PERM_TRANS = (uint)8192;
|
||||||
private uint PERM_LOCKED = (uint)540672;
|
private uint PERM_LOCKED = (uint)540672;
|
||||||
// Bypasses the permissions engine (always returns OK)
|
|
||||||
// disable in any production environment
|
// Bypasses the permissions engine
|
||||||
// TODO: Change this to false when permissions are a desired default
|
private bool m_bypassPermissions = false;
|
||||||
// TODO: Move to configuration option.
|
|
||||||
private bool m_bypassPermissions = true;
|
|
||||||
|
|
||||||
public bool BypassPermissions
|
public bool BypassPermissions
|
||||||
{
|
{
|
||||||
|
@ -55,20 +55,40 @@ namespace OpenSim.Region.Environment
|
||||||
set { m_bypassPermissions = value; }
|
set { m_bypassPermissions = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public PermissionManager()
|
#region IRegionModule Members
|
||||||
|
|
||||||
|
public void Initialise(Scene scene, IConfigSource config)
|
||||||
|
{
|
||||||
|
m_scene = scene;
|
||||||
|
|
||||||
|
// FIXME: Possibly move all permissions related stuff to its own section
|
||||||
|
IConfig myConfig = config.Configs["Startup"];
|
||||||
|
|
||||||
|
m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", false);
|
||||||
|
|
||||||
|
m_scene.RegisterModuleInterface<IScenePermissions>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public PermissionManager(Scene scene)
|
public void Close()
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(Scene scene)
|
public string Name
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
get { return "PermissionsModule"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsSharedModule
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
protected virtual void SendPermissionError(LLUUID user, string reason)
|
protected virtual void SendPermissionError(LLUUID user, string reason)
|
||||||
{
|
{
|
||||||
m_scene.EventManager.TriggerPermissionError(user, reason);
|
m_scene.EventManager.TriggerPermissionError(user, reason);
|
||||||
|
@ -159,17 +179,9 @@ namespace OpenSim.Region.Environment
|
||||||
return permission;
|
return permission;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <see cref="Opensim.Region.Environment.Interfaces.IScenePermissions></see>
|
||||||
/// Permissions check - can user enter an object?
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user">User attempting move an object</param>
|
|
||||||
/// <param name="oldPos">Source object-position</param>
|
|
||||||
/// <param name="newPos">Target object-position</param>
|
|
||||||
/// <returns>Has permission?</returns>
|
|
||||||
public virtual bool CanObjectEntry(LLUUID user, LLVector3 oldPos, LLVector3 newPos)
|
public virtual bool CanObjectEntry(LLUUID user, LLVector3 oldPos, LLVector3 newPos)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ((newPos.X > 257f || newPos.X < -1f || newPos.Y > 257f || newPos.Y < -1f))
|
if ((newPos.X > 257f || newPos.X < -1f || newPos.Y > 257f || newPos.Y < -1f))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -214,7 +226,6 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID)
|
public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Here's the way this works,
|
// Here's the way this works,
|
||||||
// ObjectFlags and Permission flags are two different enumerations
|
// ObjectFlags and Permission flags are two different enumerations
|
||||||
// ObjectFlags, however, tells the client to change what it will allow the user to do.
|
// ObjectFlags, however, tells the client to change what it will allow the user to do.
|
||||||
|
@ -296,8 +307,6 @@ namespace OpenSim.Region.Environment
|
||||||
return objectEveryoneMask;
|
return objectEveryoneMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask)
|
private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask)
|
||||||
{
|
{
|
||||||
// We are adding the temporary objectflags to the object's objectflags based on the
|
// We are adding the temporary objectflags to the object's objectflags based on the
|
||||||
|
@ -395,12 +404,7 @@ namespace OpenSim.Region.Environment
|
||||||
return permission;
|
return permission;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <see cref="Opensim.Region.Environment.Interfaces.IScenePermissions></see>
|
||||||
/// Permissions check - can user delete an object?
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user">User attempting the delete</param>
|
|
||||||
/// <param name="obj">Target object</param>
|
|
||||||
/// <returns>Has permission?</returns>
|
|
||||||
public virtual bool CanDeRezObject(LLUUID user, LLUUID obj)
|
public virtual bool CanDeRezObject(LLUUID user, LLUUID obj)
|
||||||
{
|
{
|
||||||
return GenericObjectPermission(user, obj);
|
return GenericObjectPermission(user, obj);
|
||||||
|
@ -522,7 +526,7 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
#region Communication Permissions
|
#region Communication Permissions
|
||||||
|
|
||||||
public virtual bool GenericCommunicationPermission(LLUUID user, LLUUID target)
|
protected virtual bool GenericCommunicationPermission(LLUUID user, LLUUID target)
|
||||||
{
|
{
|
||||||
bool permission = false;
|
bool permission = false;
|
||||||
string reason = "Only registered users may communicate with another account.";
|
string reason = "Only registered users may communicate with another account.";
|
|
@ -449,7 +449,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
|
||||||
float south, float east, IClientAPI remoteClient)
|
float south, float east, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
// Not a good permissions check, if in area mode, need to check the entire area.
|
// Not a good permissions check, if in area mode, need to check the entire area.
|
||||||
if (m_scene.PermissionsMngr.CanTerraform(remoteClient.AgentId, new LLVector3(north, west, 0)))
|
if (m_scene.Permissions.CanTerraform(remoteClient.AgentId, new LLVector3(north, west, 0)))
|
||||||
{
|
{
|
||||||
if (north == south && east == west)
|
if (north == south && east == west)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
protected RegionInfo m_regInfo;
|
protected RegionInfo m_regInfo;
|
||||||
protected Scene m_parentScene;
|
protected Scene m_parentScene;
|
||||||
protected PermissionManager PermissionsMngr;
|
|
||||||
protected List<EntityBase> m_updateList = new List<EntityBase>();
|
protected List<EntityBase> m_updateList = new List<EntityBase>();
|
||||||
protected int m_numRootAgents = 0;
|
protected int m_numRootAgents = 0;
|
||||||
protected int m_numPrim = 0;
|
protected int m_numPrim = 0;
|
||||||
|
@ -79,11 +78,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public InnerScene(Scene parent, RegionInfo regInfo, PermissionManager permissionsMngr)
|
public InnerScene(Scene parent, RegionInfo regInfo)
|
||||||
{
|
{
|
||||||
m_parentScene = parent;
|
m_parentScene = parent;
|
||||||
m_regInfo = regInfo;
|
m_regInfo = regInfo;
|
||||||
PermissionsMngr = permissionsMngr;
|
|
||||||
QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, (short)Constants.RegionSize, (short)Constants.RegionSize);
|
QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, (short)Constants.RegionSize, (short)Constants.RegionSize);
|
||||||
QuadTree.Subdivide();
|
QuadTree.Subdivide();
|
||||||
QuadTree.Subdivide();
|
QuadTree.Subdivide();
|
||||||
|
@ -1031,7 +1029,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
{
|
{
|
||||||
group.Resize(scale, localID);
|
group.Resize(scale, localID);
|
||||||
}
|
}
|
||||||
|
@ -1042,7 +1040,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
{
|
{
|
||||||
group.GroupResize(scale, localID);
|
group.GroupResize(scale, localID);
|
||||||
}
|
}
|
||||||
|
@ -1078,7 +1076,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
{
|
{
|
||||||
group.UpdateSingleRotation(rot, localID);
|
group.UpdateSingleRotation(rot, localID);
|
||||||
}
|
}
|
||||||
|
@ -1096,7 +1094,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
{
|
{
|
||||||
group.UpdateGroupRotation(rot);
|
group.UpdateGroupRotation(rot);
|
||||||
}
|
}
|
||||||
|
@ -1115,7 +1113,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
{
|
{
|
||||||
group.UpdateGroupRotation(pos, rot);
|
group.UpdateGroupRotation(pos, rot);
|
||||||
}
|
}
|
||||||
|
@ -1128,12 +1126,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
LLVector3 oldPos = group.AbsolutePosition;
|
LLVector3 oldPos = group.AbsolutePosition;
|
||||||
if (!PermissionsMngr.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment)
|
if (!m_parentScene.Permissions.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment)
|
||||||
{
|
{
|
||||||
group.SendGroupTerseUpdate();
|
group.SendGroupTerseUpdate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment)
|
if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment)
|
||||||
{
|
{
|
||||||
group.UpdateSinglePosition(pos, localID);
|
group.UpdateSinglePosition(pos, localID);
|
||||||
}
|
}
|
||||||
|
@ -1159,12 +1157,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!PermissionsMngr.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment)
|
if (!m_parentScene.Permissions.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment)
|
||||||
{
|
{
|
||||||
group.SendGroupTerseUpdate();
|
group.SendGroupTerseUpdate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment)
|
if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment)
|
||||||
{
|
{
|
||||||
group.UpdateGroupPosition(pos);
|
group.UpdateGroupPosition(pos);
|
||||||
}
|
}
|
||||||
|
@ -1183,7 +1181,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
{
|
{
|
||||||
group.UpdateTextureEntry(localID, texture);
|
group.UpdateTextureEntry(localID, texture);
|
||||||
}
|
}
|
||||||
|
@ -1201,7 +1199,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
|
if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, group.UUID))
|
||||||
{
|
{
|
||||||
group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes());
|
group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes());
|
||||||
}
|
}
|
||||||
|
@ -1213,7 +1211,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(objectID);
|
SceneObjectGroup group = GetGroupByPrim(objectID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))// && PermissionsMngr.)
|
if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))// && PermissionsMngr.)
|
||||||
{
|
{
|
||||||
group.GrabMovement(offset, pos, remoteClient);
|
group.GrabMovement(offset, pos, remoteClient);
|
||||||
}
|
}
|
||||||
|
@ -1235,7 +1233,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
|
if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, group.UUID))
|
||||||
{
|
{
|
||||||
group.SetPartName(Util.CleanString(name), primLocalID);
|
group.SetPartName(Util.CleanString(name), primLocalID);
|
||||||
}
|
}
|
||||||
|
@ -1252,7 +1250,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
|
if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, group.UUID))
|
||||||
{
|
{
|
||||||
group.SetPartDescription(Util.CleanString(description), primLocalID);
|
group.SetPartDescription(Util.CleanString(description), primLocalID);
|
||||||
}
|
}
|
||||||
|
@ -1265,7 +1263,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObject(agentID, group.UUID))
|
if (m_parentScene.Permissions.CanEditObject(agentID, group.UUID))
|
||||||
{
|
{
|
||||||
group.UpdateExtraParam(primLocalID, type, inUse, data);
|
group.UpdateExtraParam(primLocalID, type, inUse, data);
|
||||||
}
|
}
|
||||||
|
@ -1282,7 +1280,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanEditObjectPosition(agentID, group.GetPartsFullID(primLocalID)))
|
if (m_parentScene.Permissions.CanEditObjectPosition(agentID, group.GetPartsFullID(primLocalID)))
|
||||||
{
|
{
|
||||||
group.UpdateShape(shapeBlock, primLocalID);
|
group.UpdateShape(shapeBlock, primLocalID);
|
||||||
}
|
}
|
||||||
|
@ -1448,11 +1446,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// * Asset/DRM permission bit "modify" is enabled
|
// * Asset/DRM permission bit "modify" is enabled
|
||||||
//use CanEditObjectPosition
|
//use CanEditObjectPosition
|
||||||
|
|
||||||
if (IncludeInSearch && PermissionsMngr.CanEditObject(user, objid))
|
if (IncludeInSearch && m_parentScene.Permissions.CanEditObject(user, objid))
|
||||||
{
|
{
|
||||||
obj.AddFlag(LLObject.ObjectFlags.JointWheel);
|
obj.AddFlag(LLObject.ObjectFlags.JointWheel);
|
||||||
}
|
}
|
||||||
else if (!IncludeInSearch && PermissionsMngr.CanEditObjectPosition(user, objid))
|
else if (!IncludeInSearch && m_parentScene.Permissions.CanEditObjectPosition(user, objid))
|
||||||
{
|
{
|
||||||
obj.RemFlag(LLObject.ObjectFlags.JointWheel);
|
obj.RemFlag(LLObject.ObjectFlags.JointWheel);
|
||||||
}
|
}
|
||||||
|
@ -1485,7 +1483,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (originPrim != null)
|
if (originPrim != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanCopyObject(AgentID, originPrim.UUID))
|
if (m_parentScene.Permissions.CanCopyObject(AgentID, originPrim.UUID))
|
||||||
{
|
{
|
||||||
SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
|
SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
|
||||||
copy.AbsolutePosition = copy.AbsolutePosition + offset;
|
copy.AbsolutePosition = copy.AbsolutePosition + offset;
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
remoteClient.SendInventoryItemCreateUpdate(item);
|
remoteClient.SendInventoryItemCreateUpdate(item);
|
||||||
|
|
||||||
int userlevel = 0;
|
int userlevel = 0;
|
||||||
if (PermissionsMngr.IsEstateManager(remoteClient.AgentId))
|
if (Permissions.IsEstateManager(remoteClient.AgentId))
|
||||||
{
|
{
|
||||||
userlevel = 1;
|
userlevel = 1;
|
||||||
}
|
}
|
||||||
|
@ -784,7 +784,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
// bool permission;
|
// bool permission;
|
||||||
// permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId,
|
// permission = Permissions.CanCopyObject(remoteClient.AgentId,
|
||||||
// ((SceneObjectGroup) selectedEnt).UUID);
|
// ((SceneObjectGroup) selectedEnt).UUID);
|
||||||
|
|
||||||
// Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner
|
// Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner
|
||||||
|
@ -988,12 +988,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
bool permission;
|
bool permission;
|
||||||
if (DeRezPacket.AgentBlock.Destination == 1)
|
if (DeRezPacket.AgentBlock.Destination == 1)
|
||||||
{ // Take Copy
|
{ // Take Copy
|
||||||
permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId,
|
permission = Permissions.CanCopyObject(remoteClient.AgentId,
|
||||||
((SceneObjectGroup) selectedEnt).UUID);
|
((SceneObjectGroup) selectedEnt).UUID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Take
|
{ // Take
|
||||||
permission = PermissionsMngr.CanDeRezObject(remoteClient.AgentId,
|
permission = Permissions.CanDeRezObject(remoteClient.AgentId,
|
||||||
((SceneObjectGroup) selectedEnt).UUID);
|
((SceneObjectGroup) selectedEnt).UUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1),
|
RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1),
|
||||||
BypassRayCast, bRayEndIsIntersection,true,scale, false);
|
BypassRayCast, bRayEndIsIntersection,true,scale, false);
|
||||||
|
|
||||||
if (!PermissionsMngr.CanRezObject(remoteClient.AgentId, pos) && !attachment)
|
if (!Permissions.CanRezObject(remoteClient.AgentId, pos) && !attachment)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1361,7 +1361,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
LLUUID ownerID = item.OwnerID;
|
LLUUID ownerID = item.OwnerID;
|
||||||
|
|
||||||
if (!PermissionsMngr.CanRezObject(ownerID, pos))
|
if (!Permissions.CanRezObject(ownerID, pos))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (((SceneObjectGroup) ent).LocalId == primLocalID)
|
if (((SceneObjectGroup) ent).LocalId == primLocalID)
|
||||||
{
|
{
|
||||||
// A prim is only tainted if it's allowed to be edited by the person clicking it.
|
// A prim is only tainted if it's allowed to be edited by the person clicking it.
|
||||||
if (m_permissionManager.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || m_permissionManager.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID))
|
if (Permissions.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || Permissions.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID))
|
||||||
{
|
{
|
||||||
((SceneObjectGroup) ent).GetProperties(remoteClient);
|
((SceneObjectGroup) ent).GetProperties(remoteClient);
|
||||||
((SceneObjectGroup) ent).IsSelected = true;
|
((SceneObjectGroup) ent).IsSelected = true;
|
||||||
|
@ -112,7 +112,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (((SceneObjectGroup) ent).LocalId == primLocalID)
|
if (((SceneObjectGroup) ent).LocalId == primLocalID)
|
||||||
{
|
{
|
||||||
if (m_permissionManager.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || m_permissionManager.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID))
|
if (Permissions.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || Permissions.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID))
|
||||||
{
|
{
|
||||||
((SceneObjectGroup) ent).IsSelected = false;
|
((SceneObjectGroup) ent).IsSelected = false;
|
||||||
LandChannel.setPrimsTainted();
|
LandChannel.setPrimsTainted();
|
||||||
|
|
|
@ -114,6 +114,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
protected IXMLRPC m_xmlrpcModule;
|
protected IXMLRPC m_xmlrpcModule;
|
||||||
protected IWorldComm m_worldCommModule;
|
protected IWorldComm m_worldCommModule;
|
||||||
protected IAvatarFactory m_AvatarFactory;
|
protected IAvatarFactory m_AvatarFactory;
|
||||||
|
protected IScenePermissions m_permissions;
|
||||||
|
|
||||||
// Central Update Loop
|
// Central Update Loop
|
||||||
|
|
||||||
|
@ -169,13 +170,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
get { return m_timedilation; }
|
get { return m_timedilation; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected readonly PermissionManager m_permissionManager;
|
/// <summary>
|
||||||
// This is the instance to the permissions manager.
|
/// The reference by which general permissions in the scene can be set and queried.
|
||||||
// This manages permissions to clients on in world objects
|
/// </summary>
|
||||||
|
public IScenePermissions Permissions
|
||||||
public PermissionManager PermissionsMngr
|
|
||||||
{
|
{
|
||||||
get { return m_permissionManager; }
|
get { return m_permissions; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int TimePhase
|
public int TimePhase
|
||||||
|
@ -219,7 +219,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
public Scene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager,
|
public Scene(RegionInfo regInfo, AgentCircuitManager authen,
|
||||||
CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
|
CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
|
||||||
AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
|
AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
|
||||||
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor)
|
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor)
|
||||||
|
@ -248,10 +248,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
EventManager.OnLandObjectRemoved +=
|
EventManager.OnLandObjectRemoved +=
|
||||||
new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject);
|
new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject);
|
||||||
|
|
||||||
m_permissionManager = permissionManager;
|
m_innerScene = new InnerScene(this, m_regInfo);
|
||||||
m_permissionManager.Initialise(this);
|
|
||||||
|
|
||||||
m_innerScene = new InnerScene(this, m_regInfo, m_permissionManager);
|
|
||||||
|
|
||||||
// If the Inner scene has an Unrecoverable error, restart this sim.
|
// If the Inner scene has an Unrecoverable error, restart this sim.
|
||||||
// Currently the only thing that causes it to happen is two kinds of specific
|
// Currently the only thing that causes it to happen is two kinds of specific
|
||||||
|
@ -613,6 +610,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
|
m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets up references to loaded modules required by thie scene
|
||||||
|
/// </summary>
|
||||||
public void SetModuleInterfaces()
|
public void SetModuleInterfaces()
|
||||||
{
|
{
|
||||||
m_simChatModule = RequestModuleInterface<ISimChat>();
|
m_simChatModule = RequestModuleInterface<ISimChat>();
|
||||||
|
@ -621,6 +621,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_worldCommModule = RequestModuleInterface<IWorldComm>();
|
m_worldCommModule = RequestModuleInterface<IWorldComm>();
|
||||||
XferManager = RequestModuleInterface<IXfer>();
|
XferManager = RequestModuleInterface<IXfer>();
|
||||||
m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
|
m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
|
||||||
|
m_permissions = RequestModuleInterface<IScenePermissions>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1121,7 +1122,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the World's objects
|
/// Loads the World's objects
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void LoadPrimsFromStorage(bool m_permissions, LLUUID regionID)
|
public virtual void LoadPrimsFromStorage(LLUUID regionID)
|
||||||
{
|
{
|
||||||
m_log.Info("[SCENE]: Loading objects from datastore");
|
m_log.Info("[SCENE]: Loading objects from datastore");
|
||||||
|
|
||||||
|
@ -1243,12 +1244,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false);
|
LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false);
|
||||||
|
|
||||||
if (PermissionsMngr.CanRezObject(ownerID, pos))
|
if (Permissions.CanRezObject(ownerID, pos))
|
||||||
{
|
{
|
||||||
// rez ON the ground, not IN the ground
|
// rez ON the ground, not IN the ground
|
||||||
pos.Z += 0.25F;
|
pos.Z += 0.25F;
|
||||||
|
|
||||||
|
|
||||||
AddNewPrim(ownerID, pos, rot, shape);
|
AddNewPrim(ownerID, pos, rot, shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2499,7 +2499,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
IClientAPI controllingClient)
|
IClientAPI controllingClient)
|
||||||
{
|
{
|
||||||
// First check that this is the sim owner
|
// First check that this is the sim owner
|
||||||
if (m_permissionManager.GenericEstatePermission(agentID))
|
if (Permissions.GenericEstatePermission(agentID))
|
||||||
{
|
{
|
||||||
// User needs to be logged into this sim
|
// User needs to be logged into this sim
|
||||||
if (m_scenePresences.ContainsKey(agentID))
|
if (m_scenePresences.ContainsKey(agentID))
|
||||||
|
@ -2577,7 +2577,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
LLUUID kickUserID = new LLUUID("44e87126e7944ded05b37c42da3d5cdb");
|
LLUUID kickUserID = new LLUUID("44e87126e7944ded05b37c42da3d5cdb");
|
||||||
if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID)
|
if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID)
|
||||||
{
|
{
|
||||||
if (m_permissionManager.GenericEstatePermission(godID))
|
if (Permissions.GenericEstatePermission(godID))
|
||||||
{
|
{
|
||||||
if (agentID == kickUserID)
|
if (agentID == kickUserID)
|
||||||
{
|
{
|
||||||
|
@ -2896,7 +2896,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
else if ((parcel.landData.landFlags & (uint)Parcel.ParcelFlags.AllowGroupScripts) != 0)
|
else if ((parcel.landData.landFlags & (uint)Parcel.ParcelFlags.AllowGroupScripts) != 0)
|
||||||
{
|
{
|
||||||
if (part.OwnerID == parcel.landData.ownerID || (parcel.landData.isGroupOwned && part.GroupID == parcel.landData.groupID) || PermissionsMngr.GenericEstatePermission(part.OwnerID))
|
if (part.OwnerID == parcel.landData.ownerID || (parcel.landData.isGroupOwned && part.GroupID == parcel.landData.groupID) || Permissions.GenericEstatePermission(part.OwnerID))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,7 +191,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions)
|
public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions)
|
||||||
{
|
{
|
||||||
ForEachCurrentScene(delegate(Scene scene) { scene.PermissionsMngr.BypassPermissions = bypassPermissions; });
|
ForEachCurrentScene(delegate(Scene scene) { scene.Permissions.BypassPermissions = bypassPermissions; });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ForEachCurrentScene(Action<Scene> func)
|
private void ForEachCurrentScene(Action<Scene> func)
|
||||||
|
|
|
@ -1340,7 +1340,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (part.OwnerID != cAgentID)
|
if (part.OwnerID != cAgentID)
|
||||||
{
|
{
|
||||||
// Apply Next Owner Permissions if we're not bypassing permissions
|
// Apply Next Owner Permissions if we're not bypassing permissions
|
||||||
if (!m_scene.PermissionsMngr.BypassPermissions)
|
if (!m_scene.Permissions.BypassPermissions)
|
||||||
m_rootPart.ApplyNextOwnerPermissions();
|
m_rootPart.ApplyNextOwnerPermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -451,7 +451,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public uint GenerateClientFlags(LLUUID ObjectID)
|
public uint GenerateClientFlags(LLUUID ObjectID)
|
||||||
{
|
{
|
||||||
return m_scene.PermissionsMngr.GenerateClientFlags(m_uuid, ObjectID);
|
return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -180,8 +180,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
//Check to make sure that the script's owner is the estate manager/master
|
//Check to make sure that the script's owner is the estate manager/master
|
||||||
//World.PermissionsMngr.GenericEstatePermission(
|
//World.Permissions.GenericEstatePermission(
|
||||||
if (World.PermissionsMngr.GenericEstatePermission(m_host.OwnerID))
|
if (World.Permissions.GenericEstatePermission(m_host.OwnerID))
|
||||||
{
|
{
|
||||||
World.EventManager.TriggerRequestChangeWaterHeight((float)height);
|
World.EventManager.TriggerRequestChangeWaterHeight((float)height);
|
||||||
}
|
}
|
||||||
|
@ -2616,7 +2616,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
public void llModifyLand(int action, int brush)
|
public void llModifyLand(int action, int brush)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0)))
|
if (World.Permissions.CanTerraform(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0)))
|
||||||
{
|
{
|
||||||
NotImplemented("llModifyLand");
|
NotImplemented("llModifyLand");
|
||||||
}
|
}
|
||||||
|
@ -3869,7 +3869,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
{
|
{
|
||||||
if (m_host.ObjectOwner == parcel.landData.ownerID ||
|
if (m_host.ObjectOwner == parcel.landData.ownerID ||
|
||||||
(m_host.OwnerID == m_host.GroupID && m_host.GroupID == parcel.landData.groupID
|
(m_host.OwnerID == m_host.GroupID && m_host.GroupID == parcel.landData.groupID
|
||||||
&& parcel.landData.isGroupOwned) || World.PermissionsMngr.GenericEstatePermission(m_host.OwnerID))
|
&& parcel.landData.isGroupOwned) || World.Permissions.GenericEstatePermission(m_host.OwnerID))
|
||||||
{
|
{
|
||||||
av.StandUp();
|
av.StandUp();
|
||||||
}
|
}
|
||||||
|
|
|
@ -258,7 +258,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
if (x > 255 || x < 0 || y > 255 || y < 0)
|
if (x > 255 || x < 0 || y > 255 || y < 0)
|
||||||
LSLError("osTerrainSetHeight: Coordinate out of bounds");
|
LSLError("osTerrainSetHeight: Coordinate out of bounds");
|
||||||
|
|
||||||
if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(x, y, 0)))
|
if (World.Permissions.CanTerraform(m_host.OwnerID, new LLVector3(x, y, 0)))
|
||||||
{
|
{
|
||||||
World.Heightmap[x, y] = val;
|
World.Heightmap[x, y] = val;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -281,7 +281,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
public int osRegionRestart(double seconds)
|
public int osRegionRestart(double seconds)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
if (World.PermissionsMngr.CanRestartSim(m_host.OwnerID))
|
if (World.Permissions.CanRestartSim(m_host.OwnerID))
|
||||||
{
|
{
|
||||||
World.Restart((float)seconds);
|
World.Restart((float)seconds);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -406,7 +406,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
|
|
||||||
if (config.Configs["LL-Functions"].GetBoolean("AllowosConsoleCommand", false))
|
if (config.Configs["LL-Functions"].GetBoolean("AllowosConsoleCommand", false))
|
||||||
{
|
{
|
||||||
if (World.PermissionsMngr.CanRunConsoleCommand(m_host.OwnerID))
|
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
|
||||||
{
|
{
|
||||||
MainConsole.Instance.RunCommand(command);
|
MainConsole.Instance.RunCommand(command);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue