mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Thank you, thomax, for a patch to provide finer-grained access control to
scripting. Fixes Mantis #2862
This commit is contained in:
@@ -37,6 +37,7 @@ using Microsoft.VisualBasic;
|
||||
using log4net;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.ScriptEngine.Interfaces;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||
{
|
||||
@@ -263,7 +264,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||
/// </summary>
|
||||
/// <param name="Script">LSL script</param>
|
||||
/// <returns>Filename to .dll assembly</returns>
|
||||
public string PerformScriptCompile(string Script, string asset)
|
||||
public string PerformScriptCompile(string Script, string asset, UUID ownerUUID)
|
||||
{
|
||||
m_positionMap = null;
|
||||
m_warnings.Clear();
|
||||
@@ -341,6 +342,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||
throw new Exception(errtext);
|
||||
}
|
||||
|
||||
if(m_scriptEngine.World.Permissions.CanCompileScript(ownerUUID, (int)l) == false) {
|
||||
// Not allowed to compile to this language!
|
||||
string errtext = String.Empty;
|
||||
errtext += ownerUUID + " is not in list of allowed users for this scripting language. Script will not be executed!";
|
||||
throw new Exception(errtext);
|
||||
}
|
||||
|
||||
string compileScript = Script;
|
||||
|
||||
if (l == enumCompileType.lsl)
|
||||
|
||||
Reference in New Issue
Block a user