aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorSnoopy Pfeffer2012-03-27 22:09:58 +0200
committerSnoopy Pfeffer2012-03-27 22:09:58 +0200
commit7223b63563f28f6fe8044bdabcd1b9900d28c54a (patch)
tree7bf1df67f9a1388b940b386e64e239f52f986a4b /OpenSim/Region/CoreModules
parentHG: beginning of a more restrictive inventory access procedure (optional). Ex... (diff)
downloadopensim-SC_OLD-7223b63563f28f6fe8044bdabcd1b9900d28c54a.zip
opensim-SC_OLD-7223b63563f28f6fe8044bdabcd1b9900d28c54a.tar.gz
opensim-SC_OLD-7223b63563f28f6fe8044bdabcd1b9900d28c54a.tar.bz2
opensim-SC_OLD-7223b63563f28f6fe8044bdabcd1b9900d28c54a.tar.xz
User level based restrictions for HyperGrid teleports, asset uploads, group creations and getting contacted from other grids. Incoming HyperGrid teleports can also be restricted to local users.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs22
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs15
2 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
index 95e3aec..874693e 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
@@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
47 47
48 protected Scene m_Scene; 48 protected Scene m_Scene;
49 private bool m_dumpAssetsToFile = false; 49 private bool m_dumpAssetsToFile = false;
50 private int m_levelUpload = 0;
50 51
51 /// <summary> 52 /// <summary>
52 /// Each agent has its own singleton collection of transactions 53 /// Each agent has its own singleton collection of transactions
@@ -56,8 +57,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
56 57
57 #region IRegionModule Members 58 #region IRegionModule Members
58 59
59 public void Initialise(IConfigSource config) 60 public void Initialise(IConfigSource source)
60 { 61 {
62 IConfig sconfig = source.Configs["Startup"];
63 if (sconfig != null)
64 {
65 m_levelUpload = sconfig.GetInt("LevelUpload", 0);
66 }
61 } 67 }
62 68
63 public void AddRegion(Scene scene) 69 public void AddRegion(Scene scene)
@@ -241,7 +247,21 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
241 (AssetType)type == AssetType.Animation) && 247 (AssetType)type == AssetType.Animation) &&
242 tempFile == false) 248 tempFile == false)
243 { 249 {
250 ScenePresence avatar = null;
244 Scene scene = (Scene)remoteClient.Scene; 251 Scene scene = (Scene)remoteClient.Scene;
252 scene.TryGetScenePresence(remoteClient.AgentId, out avatar);
253
254 // check user level
255 if (avatar != null)
256 {
257 if (avatar.UserLevel < m_levelUpload)
258 {
259 remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
260 return;
261 }
262 }
263
264 // check funds
245 IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>(); 265 IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>();
246 266
247 if (mm != null) 267 if (mm != null)
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 2d73594..427a49d 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -60,6 +60,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
60 set { m_MaxTransferDistance = value; } 60 set { m_MaxTransferDistance = value; }
61 } 61 }
62 62
63 private int m_levelHGTeleport = 0;
64
63 protected bool m_Enabled = false; 65 protected bool m_Enabled = false;
64 protected Scene m_aScene; 66 protected Scene m_aScene;
65 protected List<Scene> m_Scenes = new List<Scene>(); 67 protected List<Scene> m_Scenes = new List<Scene>();
@@ -101,7 +103,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
101 { 103 {
102 IConfig transferConfig = source.Configs["EntityTransfer"]; 104 IConfig transferConfig = source.Configs["EntityTransfer"];
103 if (transferConfig != null) 105 if (transferConfig != null)
106 {
104 MaxTransferDistance = transferConfig.GetInt("max_distance", 4095); 107 MaxTransferDistance = transferConfig.GetInt("max_distance", 4095);
108 m_levelHGTeleport = transferConfig.GetInt("LevelHGTeleport", 0);
109 }
105 110
106 m_agentsInTransit = new List<UUID>(); 111 m_agentsInTransit = new List<UUID>();
107 m_Enabled = true; 112 m_Enabled = true;
@@ -227,6 +232,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
227 return; 232 return;
228 } 233 }
229 234
235 // check if HyperGrid teleport is allowed, based on user level
236 int flags = m_aScene.GridService.GetRegionFlags(sp.Scene.RegionInfo.ScopeID, reg.RegionID);
237
238 if (((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) && (sp.UserLevel < m_levelHGTeleport))
239 {
240 m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination link is non permitted hypergrid region. Unable to teleport agent.");
241 sp.ControllingClient.SendTeleportFailed("HyperGrid teleport not permitted");
242 return;
243 }
244
230 uint curX = 0, curY = 0; 245 uint curX = 0, curY = 0;
231 Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY); 246 Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY);
232 int curCellX = (int)(curX / Constants.RegionSize); 247 int curCellX = (int)(curX / Constants.RegionSize);