Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Authorize(Roles = "Admin")]
- [Authorize(Roles="admin")]
- public IActionResult About()
- {
- ViewData["Message"] = "Your application description page.";
- return View();
- }
- [Authorize(Roles ="user")]
- public IActionResult Contact()
- {
- ViewData["Message"] = "Your contact page.";
- return View();
- }
- @page
- @model AccessDeniedModel
- @{
- ViewData["Title"] = "Access denied";
- }
- <header>
- <h1 class="text-danger">@ViewData["Title"]</h1>
- <p class="text-danger">You do not have access to this resource.</p>
- </header>
Add Comment
Please, Sign In to add comment