change OSSL enable option GOD to use IsGod, so it means a active god, as my original idea

UbitUmarov [2017-01-07 21:44:01]
change OSSL enable option GOD to use IsGod, so it means a active god, as my original idea
Filename
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
bin/config-include/osslEnable.ini
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 066f6a4..07549f8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -415,24 +415,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
                         }
                     }

-                    //Only gods may use the function
-                    if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD"))
+
+                    //Only grid gods may use the function
+                    if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GRID_GOD"))
                     {
-                        if (World.Permissions.IsGod(ownerID))
+                        if (World.Permissions.IsGridGod(ownerID))
                         {
                             return String.Empty;
                         }
                     }

-                    //Only grid gods may use the function
-                    if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GRID_GOD"))
+                    //Only active gods may use the function
+                    if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD"))
                     {
-                        if (World.Permissions.IsGridGod(ownerID))
+                        ScenePresence sp = World.GetScenePresence(ownerID);
+                        if (sp != null && !sp.IsDeleted && sp.IsGod)
                         {
                             return String.Empty;
                         }
                     }

+
                     if (!m_FunctionPerms[function].AllowedCreators.Contains(m_item.CreatorID))
                         return(
                             String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.",
diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini
index b96688b..3859ba6 100644
--- a/bin/config-include/osslEnable.ini
+++ b/bin/config-include/osslEnable.ini
@@ -38,7 +38,7 @@
   ;    against the owner of the object containing the script.
   ;    The comma separated entries in the list may be one of:
   ;           "GRID_GOD" -- enable for users with UserLevel >= 200
-  ;           "GOD" -- enable for users with any type of god rights
+  ;           "GOD" -- enable for present and with active god power
   ;           "ESTATE_MANAGER" -- enable for estate manager
   ;           "ESTATE_OWNER" -- enable for estate owner
   ;           "PARCEL_OWNER" -- enable for parcel owner
ViewGit