diff options
Merge branch 'avination-current' of ssh://3dhosting.de/var/git/careminster into avination-current
Conflicts:
bin/Regions/Regions.ini.example
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index ddaa227..79dd4a0 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -38,6 +38,7 @@ using OpenSim.Region.Framework.Scenes; | |||
38 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
39 | 39 | ||
40 | using Mono.Addins; | 40 | using Mono.Addins; |
41 | using PermissionMask = OpenSim.Framework.PermissionMask; | ||
41 | 42 | ||
42 | namespace OpenSim.Region.CoreModules.World.Permissions | 43 | namespace OpenSim.Region.CoreModules.World.Permissions |
43 | { | 44 | { |
@@ -156,9 +157,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
156 | 157 | ||
157 | public void Initialise(IConfigSource config) | 158 | public void Initialise(IConfigSource config) |
158 | { | 159 | { |
159 | IConfig myConfig = config.Configs["Startup"]; | 160 | string permissionModules = Util.GetConfigVarFromSections<string>(config, "permissionmodules", |
160 | 161 | new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); | |
161 | string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | ||
162 | 162 | ||
163 | List<string> modules = new List<string>(permissionModules.Split(',')); | 163 | List<string> modules = new List<string>(permissionModules.Split(',')); |
164 | 164 | ||
@@ -167,26 +167,34 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
167 | 167 | ||
168 | m_Enabled = true; | 168 | m_Enabled = true; |
169 | 169 | ||
170 | m_allowGridGods = myConfig.GetBoolean("allow_grid_gods", false); | 170 | m_allowGridGods = Util.GetConfigVarFromSections<bool>(config, "allow_grid_gods", |
171 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); | 171 | new string[] { "Startup", "Permissions" }, false); |
172 | m_propagatePermissions = myConfig.GetBoolean("propagate_permissions", true); | 172 | m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(config, "serverside_object_permissions", |
173 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); | 173 | new string[] { "Startup", "Permissions" }, true); |
174 | m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); | 174 | m_propagatePermissions = Util.GetConfigVarFromSections<bool>(config, "propagate_permissions", |
175 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); | 175 | new string[] { "Startup", "Permissions" }, true); |
176 | 176 | m_RegionOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_owner_is_god", | |
177 | m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false); | 177 | new string[] { "Startup", "Permissions" }, true); |
178 | m_RegionManagerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_manager_is_god", | ||
179 | new string[] { "Startup", "Permissions" }, false); | ||
180 | m_ParcelOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "parcel_owner_is_god", | ||
181 | new string[] { "Startup", "Permissions" }, true); | ||
182 | |||
183 | m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions", | ||
184 | new string[] { "Startup", "Permissions" }, false); | ||
178 | 185 | ||
179 | m_allowedScriptCreators | 186 | m_allowedScriptCreators |
180 | = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); | 187 | = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators); |
181 | m_allowedScriptEditors | 188 | m_allowedScriptEditors |
182 | = ParseUserSetConfigSetting(myConfig, "allowed_script_editors", m_allowedScriptEditors); | 189 | = ParseUserSetConfigSetting(config, "allowed_script_editors", m_allowedScriptEditors); |
183 | 190 | ||
184 | if (m_bypassPermissions) | 191 | if (m_bypassPermissions) |
185 | m_log.Info("[PERMISSIONS]: serverside_object_permissions = false in ini file so disabling all region service permission checks"); | 192 | m_log.Info("[PERMISSIONS]: serverside_object_permissions = false in ini file so disabling all region service permission checks"); |
186 | else | 193 | else |
187 | m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); | 194 | m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); |
188 | 195 | ||
189 | string grant = myConfig.GetString("GrantLSL", ""); | 196 | string grant = Util.GetConfigVarFromSections<string>(config, "GrantLSL", |
197 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
190 | if (grant.Length > 0) | 198 | if (grant.Length > 0) |
191 | { | 199 | { |
192 | foreach (string uuidl in grant.Split(',')) | 200 | foreach (string uuidl in grant.Split(',')) |
@@ -196,7 +204,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
196 | } | 204 | } |
197 | } | 205 | } |
198 | 206 | ||
199 | grant = myConfig.GetString("GrantCS", ""); | 207 | grant = Util.GetConfigVarFromSections<string>(config, "GrantCS", |
208 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
200 | if (grant.Length > 0) | 209 | if (grant.Length > 0) |
201 | { | 210 | { |
202 | foreach (string uuidl in grant.Split(',')) | 211 | foreach (string uuidl in grant.Split(',')) |
@@ -206,7 +215,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
206 | } | 215 | } |
207 | } | 216 | } |
208 | 217 | ||
209 | grant = myConfig.GetString("GrantVB", ""); | 218 | grant = Util.GetConfigVarFromSections<string>(config, "GrantVB", |
219 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
210 | if (grant.Length > 0) | 220 | if (grant.Length > 0) |
211 | { | 221 | { |
212 | foreach (string uuidl in grant.Split(',')) | 222 | foreach (string uuidl in grant.Split(',')) |
@@ -216,7 +226,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
216 | } | 226 | } |
217 | } | 227 | } |
218 | 228 | ||
219 | grant = myConfig.GetString("GrantJS", ""); | 229 | grant = Util.GetConfigVarFromSections<string>(config, "GrantJS", |
230 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
220 | if (grant.Length > 0) | 231 | if (grant.Length > 0) |
221 | { | 232 | { |
222 | foreach (string uuidl in grant.Split(',')) | 233 | foreach (string uuidl in grant.Split(',')) |
@@ -226,7 +237,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
226 | } | 237 | } |
227 | } | 238 | } |
228 | 239 | ||
229 | grant = myConfig.GetString("GrantYP", ""); | 240 | grant = Util.GetConfigVarFromSections<string>(config, "GrantYP", |
241 | new string[] { "Startup", "Permissions" }, string.Empty); | ||
230 | if (grant.Length > 0) | 242 | if (grant.Length > 0) |
231 | { | 243 | { |
232 | foreach (string uuidl in grant.Split(',')) | 244 | foreach (string uuidl in grant.Split(',')) |
@@ -464,11 +476,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
464 | /// <param name="settingName"></param> | 476 | /// <param name="settingName"></param> |
465 | /// <param name="defaultValue">The default value for this attribute</param> | 477 | /// <param name="defaultValue">The default value for this attribute</param> |
466 | /// <returns>The parsed value</returns> | 478 | /// <returns>The parsed value</returns> |
467 | private static UserSet ParseUserSetConfigSetting(IConfig config, string settingName, UserSet defaultValue) | 479 | private static UserSet ParseUserSetConfigSetting(IConfigSource config, string settingName, UserSet defaultValue) |
468 | { | 480 | { |
469 | UserSet userSet = defaultValue; | 481 | UserSet userSet = defaultValue; |
470 | 482 | ||
471 | string rawSetting = config.GetString(settingName, defaultValue.ToString()); | 483 | string rawSetting = Util.GetConfigVarFromSections<string>(config, settingName, |
484 | new string[] {"Startup", "Permissions"}, defaultValue.ToString()); | ||
472 | 485 | ||
473 | // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term | 486 | // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term |
474 | // this should disappear. | 487 | // this should disappear. |