127523f8bb57d014fbc36b7064c3278a7d9b1973
FAQ/Questions/Applying-Security.md
| ... | ... | @@ -8,26 +8,28 @@ Izenda offers many various methods of implementing security over the scope of yo |
| 8 | 8 | |
| 9 | 9 | ##Basic security sample |
| 10 | 10 | |
| 11 | -Here we demonstrate what basic security settings might look like in your application. Note that the code below would exist inside the ``InitializeReporting()`` method. In this case, initialization would be performed while confirming the user's identity. You may also call the ``InitializeReporting()`` method after the user has been authenticated. |
|
| 11 | +Here we demonstrate what basic security settings might look like in your application. In this case, initialization would be performed while confirming the user's identity. You may also call the ``InitializeReporting()`` method after the user has been authenticated. |
|
| 12 | 12 | |
| 13 | 13 | ```csharp |
| 14 | -AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 15 | -AdHocSettings.SqlServerConnectionString = "..."; |
|
| 16 | -AdHocSettings.CurrentUserName = GetUserName(); |
|
| 17 | -AdHocSettings.CurrentUserTenantId = GetTenantID(); |
|
| 18 | -string role = GetUserRoleFromApp() |
|
| 19 | -if(role == "Admin") |
|
| 20 | -{ |
|
| 21 | - Izenda.AdHoc.AdHocSettings.VisibleDataSources = |
|
| 22 | - new string[] { "Purchasing.Vendor", "Products", "Orders", "Order Details", "Customers" }; |
|
| 23 | -} |
|
| 24 | -else |
|
| 25 | -{ |
|
| 26 | - Izenda.AdHoc.AdHocSettings.VisibleDataSources = new string[] { "Products", "Orders", "Customers" }; |
|
| 14 | +public static void InitializeReporting() { |
|
| 15 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 16 | + AdHocSettings.SqlServerConnectionString = "..."; |
|
| 17 | + AdHocSettings.CurrentUserName = GetUserName(); |
|
| 18 | + AdHocSettings.CurrentUserTenantId = GetTenantID(); |
|
| 19 | + string role = GetUserRoleFromApp() |
|
| 20 | + if(role == "Admin") |
|
| 21 | + { |
|
| 22 | + Izenda.AdHoc.AdHocSettings.VisibleDataSources = |
|
| 23 | + new string[] { "Purchasing.Vendor", "Products", "Orders", "Order Details", "Customers" }; |
|
| 24 | + } |
|
| 25 | + else |
|
| 26 | + { |
|
| 27 | + Izenda.AdHoc.AdHocSettings.VisibleDataSources = new string[] { "Products", "Orders", "Customers" }; |
|
| 27 | 28 | Izenda.AdHoc.AdHocSettings.CurrentUserIsAdmin = false; |
| 28 | 29 | Izenda.AdHoc.AdHocSettings.ShowSettingsButton = false; |
| 29 | 30 | Izenda.AdHoc.AdHocSettings.ShowSqlOutputIcon = false; |
| 30 | 31 | Izenda.AdHoc.AdHocSettings.HiddenFilters["ShipCountry"]= GetUserCountry(); |
| 32 | + } |
|
| 31 | 33 | } |
| 32 | 34 | ``` |
| 33 | 35 |