Blazor Server Project #15: Role-based Authorization
A practical security guide: add role services, specify & implement role-based authorization, assign roles to users, and test the authorization
Published in
9 min readSep 5, 2022
Table of Contents
- Overview
- Add Role Services
- Specify and Implement Role-based Authorization
▸ Menu authorization
▸ Page and element authorization - Assign Roles to Users
▸ Register users
▸ View user data
▸ Input roles data
▸ Assign roles to users - Test the Authorization
▸ Users with no authentication and no authorization
▸ Users with no role
▸ Users with a "User" role
▸ Users with "Admin" and "User" roles - Summary
- References
This article is the fifteenth in a series covering the Blazor Server Project:
(1) How to create a CRUD operation using Dapper
(2) Building a dropdown list involves a 1:N relationship
(3) How to implement a checkbox list involving an M:N relationships
(4) Understanding URL routing and navigation
(5) Creating and using page layout
(6) How to create a reusable modal dialog component
(7) Practical guide to making a master-detail page
(8) Master-detail page using dynamic query
(9) How to avoid SQL…