diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 72a8dc56e1..f010f7d8f8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -187,30 +187,41 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!m_FunctionPerms.ContainsKey(function)) { - string perm = m_ScriptEngine.Config.GetString("Allow_"+function, "true"); - bool allowed; - - if (bool.TryParse(perm, out allowed)) + string perm = m_ScriptEngine.Config.GetString("Allow_"+function, ""); + if (perm == "") { - // Boolean given - if (allowed) - m_FunctionPerms[function] = null; // a null value is all - else - m_FunctionPerms[function] = new List(); // Empty list = none + m_FunctionPerms[function] = null; // a null value is default } else { - m_FunctionPerms[function] = new List(); + bool allowed; - string[] ids = perm.Split(new char[] {','}); - foreach (string id in ids) + if (bool.TryParse(perm, out allowed)) { - string current = id.Trim(); - UUID uuid; - - if (UUID.TryParse(current, out uuid)) + // Boolean given + if (allowed) { - m_FunctionPerms[function].Add(uuid); + m_FunctionPerms[function] = new List(); + m_FunctionPerms[function].Add(UUID.Zero); + } + else + m_FunctionPerms[function] = new List(); // Empty list = none + } + else + { + m_FunctionPerms[function] = new List(); + + string[] ids = perm.Split(new char[] {','}); + foreach (string id in ids) + { + string current = id.Trim(); + UUID uuid; + + if (UUID.TryParse(current, out uuid)) + { + if (uuid != uuid.Zero) + m_FunctionPerms[function].Add(uuid); + } } } } @@ -223,6 +234,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // to use that particular function. False causes an empty // list and therefore means "no one" // + // To allow use by anyone, the list contains UUID.Zero + // if (m_FunctionPerms[function] == null) // No list = true { if (level > m_MaxThreatLevel) @@ -230,8 +243,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - if (!m_FunctionPerms[function].Contains(m_host.OwnerID)) - throw new Exception("Threat level too high - "+function); + if (!m_FunctionPerms[function].Contains(UUID.Zero)) + { + if (!m_FunctionPerms[function].Contains(m_host.OwnerID)) + throw new Exception("Threat level too high - "+function); + } } } diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 1464bee73b..cee8da0566 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -835,8 +835,9 @@ ; OS Functions enable/disable ; For each function, you can add one line, as shown + ; The default for all functions allows them if below threat level - ; true is the default for all functions, and allows them if below threat level + ; true allows the use of the function unconditionally ; Allow_osSetRegionWaterHeight = true ; false disables the function completely