diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent')
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs | 22 |
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) |