Coder Social home page Coder Social logo

devexpress-examples / dashboarduserbasedmvc Goto Github PK

View Code? Open in Web Editor NEW
2.0 55.0 2.0 2.04 MB

This example shows how to configure the Dashboard extension for MVC so that it works in the multi-user environment.

License: Other

C# 5.70% ASP.NET 0.04% JavaScript 92.64% HTML 1.62%
business-intelligence dashboard multi-tenant multi-user roles authentication asp-net-mvc web-dashboard dashboard-for-mvc security

dashboarduserbasedmvc's Introduction

Dashboard for MVC - How to implement multi-tenant Dashboard architecture

This example shows how to configure the Dashboard control so that it works in the multi-user environment.

You can identify a user in the current session and return the following user-specific content:

Dashboards

Custom dashboard storage allows you to specify which dashboards the user can access, edit, and save.

API: IEditableDashboardStorage Interface

Files to review: CustomDashboardStorage.cs

Data Sources

Custom data source storage allows you to specify which data sources are available to the user.

API: IDataSourceStorage Interface

Files to review: CustomDataSourceStorage.cs

Data Source Schema

A custom data source schema provider allows you to filter the data source for different users to show only a part of the data source.

API: DBSchemaProviderEx Class

Files to review: CustomDBSchemaProvider.cs

Connection Strings

A custom connection string provider allows you to specify connection strings depending on the user's access rights.

API: IDataSourceWizardConnectionStringsProvider Interface

Files to review: CustomConnectionStringProvider.cs

Working Mode

The Web Dashboard control can operate in ViewerOnly mode for unauthorized users. To do this, handle the DashboardConfigurator.VerifyClientTrustLevel event and set the e.ClientTrustLevel property to Restricted. This setting prevents inadvertent or unauthorized modifications of dashboards stored on a server. You can find more information in the following help section: Security Considerations - Working Mode Access Rights.

API: DashboardConfigurator.VerifyClientTrustLevel Event

Files to review: Dashboard.cshtml and DashboardConfig.cs

Example Structure

You can limit access to sensitive information depending on the current user's ID. Every custom store/provider reads 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 features available to the selected user. Below is a table that illustrates the user IDs and their associated rights in this example:

Role Dashboard Storage DataSource Storage ConnectionString Provider DBSchema Provider Working Mode Create/Edit
Admin dashboard1_admin, dashboard2_admin SqlDataSource, JsonDataSource Northwind, CarsXtraScheduling All (Categories, Products, Cars,...) Designer, Viewer Yes
User dashboard1_user SqlDataSource CarsXtraScheduling Cars Designer, Viewer No
Guest dashboard1_guest - - - ViewerOnly -
Unauthorized - - - - ViewerOnly -

Documentation

More Examples

dashboarduserbasedmvc's People

Contributors

alexanderkovalenko avatar devexpressexamplebot avatar natakazakova avatar pollyndos avatar sergeynakhankov avatar stason4eg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kadiraba sbnair

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.