API/AdHocConfig.md
... ...
@@ -54,7 +54,8 @@ These methods are overridable in any class that inherits from FileSystemAdHocCon
54 54
//The main reporting class, usually declared in global.asax. This can inherit FileSystemAdHocConfig or DatabaseAdHocConfig
55 55
public class CustomAdHocConfig : Izenda.AdHoc.FileSystemAdHocConfig
56 56
{
57
- //Initializing these settings in a static context is a best practice for Izenda to run smoothly. This method will need to be called on your reporting pages or from Session_Start().
57
+ //Initializing these settings in a static context is a best practice for Izenda to run smoothly.
58
+ //This method will need to be called on your reporting pages in the OnPreInit() method.
58 59
public static void InitializeReporting()
59 60
{
60 61
//Check to see if we've already initialized.
... ...
@@ -77,7 +78,7 @@ public class CustomAdHocConfig : Izenda.AdHoc.FileSystemAdHocConfig
77 78
78 79
//Pass User Credentials. Set user-specific settings after we initialize the user
79 80
AdHocSettings.CurrentUserName = HttpContext.Current.Session["UserName"] as string;
80
- AdHocSettings.CurrentUserIsAdmin = true;
81
+ AdHocSettings.CurrentUserIsAdmin = HttpContext.Current.Request.Params["UserIsAdmin"] == null ? false : HttpContext.Current.Request.Params["UserIsAdmin"].ToString().ToLower() == "true" ? true : false;
81 82
AdHocSettings.VisibleDataSources = new string[] { "Orders", "Employees", "AdminData" };
82 83
83 84
//Filters results for data sources containing ClientID