aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Agent
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/Agent
parentHG: beginning of a more restrictive inventory access procedure (optional). Ex... (diff)
downloadopensim-SC-7223b63563f28f6fe8044bdabcd1b9900d28c54a.zip
opensim-SC-7223b63563f28f6fe8044bdabcd1b9900d28c54a.tar.gz
opensim-SC-7223b63563f28f6fe8044bdabcd1b9900d28c54a.tar.bz2
opensim-SC-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/Agent')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs22
1 files changed, 21 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)