From c2d3d8d88e05654a457a5d0591c19ba9337ed527 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 21 Nov 2008 17:28:57 +0000 Subject: * Improve and correct messages given to the user when permission is denied for a particular OSSL function * I don't believe that the extra information given is anything that couldn't be worked out by trial and error --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index cfe5c48..f46fdae 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -183,7 +183,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void CheckThreatLevel(ThreatLevel level, string function) { if (!m_OSFunctionsEnabled) - OSSLError(function+": permission denied"); // throws + OSSLError(String.Format("{0} permission denied. All OS functions are disabled.", function)); // throws if (!m_FunctionPerms.ContainsKey(function)) { @@ -239,14 +239,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (m_FunctionPerms[function] == null) // No list = true { if (level > m_MaxThreatLevel) - throw new Exception("Threat level too high - "+function); + OSSLError( + String.Format( + "{0} permission denied. Allowed threat level is {1} but function threat level is {2}.", + function, m_MaxThreatLevel, level)); } else { if (!m_FunctionPerms[function].Contains(UUID.Zero)) { if (!m_FunctionPerms[function].Contains(m_host.OwnerID)) - throw new Exception("Threat level too high - "+function); + OSSLError( + String.Format("{0} permission denied. Prim owner is not in the list of users allowed to execute this function.", + function)); } } } -- cgit v1.1