This example shows how to configure the Dashboard control so that it loads data in the multi-user environment.
You can identify a user in the current session and handle the following events to select the underlying data source:
- DashboardConfigurator.ConfigureDataConnection
- DashboardConfigurator.DataLoading
- DashboardConfigurator.CustomFilterExpression
- DashboardConfigurator.DataSourceCacheKeyCreated
You can limit access to data depending on the current user's ID. This ID is stored in the HttpContext.Current.Session["CurrentUser"]
value from session state.
When the application starts, you see the Index view with a ComboBox in which you can select a user. When you click the Sign in button, the ID of the selected user is passed to the HttpContext.Current.Session["CurrentUser"]
variable and you are redirected to the Dashboard view. In this view, the Web Dashboard control displays the lists of dashboards and every dashboard loads data available to the selected user. Below is a table that illustrates the user IDs and their associated datasources in this example:
Role | Sql | Json | Excel | Object | OLAP | Extract | Entity Framework |
---|---|---|---|---|---|---|---|
Admin | Categories | Customers | Bikes | Sales | Customers | Sales | Categories |
User | Categories from different source with optional filter | Customers from different source with optional filter | Bikes from different source | Sales from different source | - | - | Categories from different source |
- Dashboard for MVC - How to implement multi-tenant Dashboard architecture
- Dashboard for MVC- How to load and save dashboards from/to a database
- Dashboard for ASP.NET Core - How to implement multi-tenant Dashboard architecture
- Dashboard for ASP.NET Core - How to load different data based on the current user
- Dashboard for ASP.NET Core - How to implement authentication
(you will be redirected to DevExpress.com to submit your response)