Changeset 251 for binary-improvements/MapRendering/Web/WebPermissions.cs
- Timestamp:
- Oct 28, 2015, 7:51:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/WebPermissions.cs
r244 r251 99 99 if (!string.IsNullOrEmpty (_module)) { 100 100 lock (this) { 101 knownModules.Add (_module, new WebModulePermission (_module, 0)); 101 if (!IsKnownModule( _module)) { 102 knownModules.Add (_module, new WebModulePermission (_module, 0)); 103 } 102 104 } 103 105 } … … 269 271 270 272 using (StreamWriter sw = new StreamWriter(GetFullPath ())) { 271 sw.WriteLine ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); 272 sw.WriteLine ("<webpermissions>"); 273 sw.WriteLine (" <admintokens>"); 274 sw.WriteLine (" <!-- <token name=\"adminuser1\" token=\"supersecrettoken\" permission_level=\"0\" /> -->"); 275 foreach (AdminToken at in admintokens.Values) { 276 sw.WriteLine (string.Format (" <token name=\"{0}\" token=\"{1}\" permission_level=\"{2}\" />", at.name, at.token, at.permissionLevel)); 277 } 278 sw.WriteLine (" </admintokens>"); 279 sw.WriteLine (); 280 sw.WriteLine (" <permissions>"); 281 sw.WriteLine (" <!-- <permission module=\"webapi.executeconsolecommand\" permission_level=\"0\" /> -->"); 282 sw.WriteLine (" <!-- <permission module=\"webapi.getplayersonline\" permission_level=\"1\" /> -->"); 283 sw.WriteLine (" <!-- <permission module=\"web.map\" permission_level=\"1000\" /> -->"); 284 foreach (WebModulePermission wap in modules.Values) { 285 sw.WriteLine (string.Format (" <permission module=\"{0}\" permission_level=\"{1}\" />", wap.module, wap.permissionLevel)); 286 } 287 sw.WriteLine (" </permissions>"); 288 sw.WriteLine (); 289 sw.WriteLine ("</webpermissions>"); 290 273 sw.WriteLine ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); 274 sw.WriteLine ("<webpermissions>"); 275 sw.WriteLine (); 276 sw.WriteLine (" <admintokens>"); 277 sw.WriteLine (" <!-- <token name=\"adminuser1\" token=\"supersecrettoken\" permission_level=\"0\" /> -->"); 278 foreach (AdminToken at in admintokens.Values) { 279 sw.WriteLine (string.Format (" <token name=\"{0}\" token=\"{1}\" permission_level=\"{2}\" />", at.name, at.token, at.permissionLevel)); 280 } 281 sw.WriteLine (" </admintokens>"); 282 sw.WriteLine (); 283 sw.WriteLine (" <permissions>"); 284 foreach (WebModulePermission wap in modules.Values) { 285 sw.WriteLine (string.Format (" <permission module=\"{0}\" permission_level=\"{1}\" />", wap.module, wap.permissionLevel)); 286 } 287 sw.WriteLine (" <!-- <permission module=\"web.map\" permission_level=\"1000\" /> -->"); 288 sw.WriteLine (); 289 sw.WriteLine (" <!-- <permission module=\"webapi.getlog\" permission_level=\"0\" /> -->"); 290 sw.WriteLine (" <!-- <permission module=\"webapi.executeconsolecommand\" permission_level=\"0\" /> -->"); 291 sw.WriteLine (); 292 sw.WriteLine (" <!-- <permission module=\"webapi.getstats\" permission_level=\"1000\" /> -->"); 293 sw.WriteLine (" <!-- <permission module=\"webapi.getplayersonline\" permission_level=\"1000\" /> -->"); 294 sw.WriteLine (); 295 sw.WriteLine (" <!-- <permission module=\"webapi.getplayerslocation\" permission_level=\"1000\" /> -->"); 296 sw.WriteLine (" <!-- <permission module=\"webapi.viewallplayers\" permission_level=\"1\" /> -->"); 297 sw.WriteLine (); 298 sw.WriteLine (" <!-- <permission module=\"webapi.getlandclaims\" permission_level=\"1000\" /> -->"); 299 sw.WriteLine (" <!-- <permission module=\"webapi.viewallclaims\" permission_level=\"1\" /> -->"); 300 sw.WriteLine (); 301 sw.WriteLine (" <!-- <permission module=\"webapi.getplayerinventory\" permission_level=\"1\" /> -->"); 302 sw.WriteLine (); 303 sw.WriteLine (" <!-- <permission module=\"webapi.gethostilelocation\" permission_level=\"1\" /> -->"); 304 sw.WriteLine (" <!-- <permission module=\"webapi.getanimalslocation\" permission_level=\"1\" /> -->"); 305 sw.WriteLine (" </permissions>"); 306 sw.WriteLine (); 307 sw.WriteLine ("</webpermissions>"); 308 291 309 sw.Flush (); 292 310 sw.Close ();
Note:
See TracChangeset
for help on using the changeset viewer.