Quick-Start.md
... ...
@@ -88,4 +88,48 @@ The Izenda Reports platform includes a robust and flexible security model which
88 88
89 89
90 90
91
-*Basic Login Security - Place in PostLogin() or InitializeReporting() method of CustomAdHocConfig which is normally found in Global.asax.*
... ...
\ No newline at end of file
0
+*Basic Login Security - Place in PostLogin() or InitializeReporting() method of CustomAdHocConfig which is normally found in Global.asax.*
1
+
2
+``` c#
3
+//Pass User Credentials
4
+AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
5
+AdHocSettings.CurrentUserName = GetUserName();
6
+AdHocSettings.CurrentUserTenantId = GetTenantID();
7
+AdHocSettings.CurrentUserIsAdmin = true;
8
+AdHocSettings.VisibleDataSources = new string[] { "Products", "Orders", "Customers" };
9
+```
10
+
11
+*Multi-Role Scenario - Apply specific limitations to certain roles*
12
+
13
+``` c#
14
+string role = GetUserRoleFromApp()
15
+if(role == "Admin")
16
+{
17
+ Izenda.AdHoc.AdHocSettings.VisibleDataSources = new string[] { "Purchasing.Vendor", "Products", "Orders", "Order Details", "Customers" };
18
+}
19
+else
20
+{
21
+ Izenda.AdHoc.AdHocSettings.VisibleDataSources = new string[] { "Products", "Orders", "Customers" };
22
+ Izenda.AdHoc.AdHocSettings.CurrentUserIsAdmin = false;
23
+ Izenda.AdHoc.AdHocSettings.ShowSettingsButton = false;
24
+ Izenda.AdHoc.AdHocSettings.ShowSqlOutputIcon = false;
25
+ Izenda.AdHoc.AdHocSettings.HiddenFilters["ShipCountry"] = GetUserCountry();
26
+}
27
+```
28
+
29
+*The PostLogin() method needs to be called at the end of your authentication process after user credentials are added to the session.*
30
+
31
+``` c#
32
+// Call the Izenda PostLogin() from your login page after authentication is complete
33
+Izenda.AdHoc.AdHocSettings.AdHocConfig.PostLogin();
34
+```
35
+
36
+*Once security is fully configured, add the following code to ConfigureSettings() method to prevent users from navigating to reports without logging in first.*
37
+
38
+``` c#
39
+// Require Login once security configured.
40
+AdHocSettings.RequireLogin = false;
41
+AdHocSettings.LoginUrl = "INSERT_YOUR_LOGIN_PAGE_HERE";
42
+```
43
+
44
+Continue to [[Security]]
... ...
\ No newline at end of file