Skip to content

Commit 65abab1

Browse files
authored
Merge pull request #1 from DevExpress-Examples/natakazakova-readme
Update Readme.md
2 parents 73745c2 + 70431f8 commit 65abab1

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

Readme.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,39 @@
44
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
55
<!-- default badges end -->
66

7-
# Dashboard for MVC - How to create a custom dashboard controller
7+
# Dashboard for MVC - How to Create a Restricted Dashboard Controller
88

9-
The example shows how to create a custom dashboard controller for the [Web Dashboard](https://docs.devexpress.com/Dashboard/16977/web-dashboard/aspnet-mvc-dashboard-extension) in an ASP.NET MVC application.
9+
You can do one of the following to prevent inadvertent or unauthorized dashboard modifications and protect dashboards stored on a server:
1010

11-
Inherit the [DashboardController](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.DashboardController) class to create a custom dashboard controller. Pass its name to the [RouteCollectionExtension.MapDashboardRoute](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.RouteCollectionExtension.MapDashboardRoute(System.Web.Routing.RouteCollection-System.String-System.String-System.String--)) method when you configure routing and to the [DashboardExtensionSettings.ControllerName](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.DashboardExtensionSettings.ControllerName) property when you configure a control on the page.
11+
- Handle the [DashboardConfigurator.VerifyClientTrustLevel](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.DashboardConfigurator.VerifyClientTrustLevel) event and set [e.ClientTrustLevel](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.VerifyClientTrustLevelEventArgs.ClientTrustLevel) to `Restricted` mode.
12+
- Derive a custom dashboard controller from [RestrictedDashboardController](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.RestrictedDashboardController) instead of [DashboardController](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.DashboardController).
1213

13-
In this example, the custom controller name is `DefaultDashboard`.
14+
The example shows how to create a restricted dashboard controller for the [Web Dashboard](https://docs.devexpress.com/Dashboard/16977/web-dashboard/aspnet-mvc-dashboard-extension) in an ASP.NET MVC application.
15+
16+
## Example Description
1417

18+
Inherit the [DashboardController](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.DashboardController) class to create a custom dashboard controller. Add its name (without a `Controller` prefix) to the following places:
19+
- The [RouteCollectionExtension.MapDashboardRoute](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.RouteCollectionExtension.MapDashboardRoute.overloads) method when you configure routing;
20+
- The [DashboardExtensionSettings.ControllerName](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.DashboardExtensionSettings.ControllerName) property when you configure a control on the page.
21+
22+
In this example, the custom controller name is `DefaultDashboard`.
1523

1624
<!-- default file list -->
1725
## Files to Look At
1826

19-
* [DashboardConfig.cs](./CS/MvcCustomController/App_Start/DashboardConfig.cs#L12)
20-
* [DefaultDashboardController.cs](./CS/MvcCustomController/Controllers/DefaultDashboardController.cs)
21-
* [Index.cshtml](./CS/MvcCustomController/Views/Home/Index.cshtml#L8)
27+
* [DashboardConfig.cs](./CS/MvcCustomController/App_Start/DashboardConfig.cs#L12) (VB: [DashboardConfig.vb](./VB/MvcCustomController/App_Start/DashboardConfig.vb#L10))
28+
* [DefaultDashboardController.cs](./CS/MvcCustomController/Controllers/DefaultDashboardController.cs) (VB: [DefaultDashboardController.vb](./VB/MvcCustomController/Controllers/DefaultDashboardController.vb))
29+
* [Index.cshtml](./CS/MvcCustomController/Views/Home/Index.cshtml#L7) (VB: [Index.vbhtml](./VB/MvcCustomController/Views/Home/Index.vbhtml#L6))
2230
<!-- default file list end -->
2331

2432
## Documentation
2533

26-
- [DashboardController](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.DashboardController)
34+
- [RestrictedDashboardController](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.Mvc.RestrictedDashboardController)
35+
- [Security Considerations in Web](https://docs.devexpress.com/Dashboard/118651/designer-and-viewer-applications/web-dashboard/security-considerations)
2736

2837
## More Examples
2938

30-
- [Dashboard for ASP.NET Core - How to create a custom dashboard controller](https://github.com/DevExpress-Examples/dashboard-for-asp-net-core-custom-dashboard-controller)
39+
- [Dashboard for ASP.NET Core - How to create a restricted dashboard controller](https://github.com/DevExpress-Examples/asp-net-core-dashboard-restricted-controller)
3140
- [Dashboard for MVC - How to use separate server-side settings for different views](https://github.com/DevExpress-Examples/dashboard-for-mvc-use-separate-server-side-settings-for-different-views)
3241
- [Dashboard for MVC - How to implement multi-tenant Dashboard architecture](https://github.com/DevExpress-Examples/DashboardUserBasedMVC)
3342
- [Dashboard for MVC - How to load different data based on the current user](https://github.com/DevExpress-Examples/DashboardDifferentUserDataMVC)

0 commit comments

Comments
 (0)