Dynamic Role-Based Authorization in ASP.NET Core 2.0


관련 자료

 

 

Dynamic Role-Based Authorization in ASP.NET Core 2.0

You already know how role-based authorization works in ASP.NET Core but what if you don't want hardcode roles in authorization attribute or create roles later and specify in which controller and action it has access without touching source code?

www.codeproject.com

 

 

mo-esmp/DynamicRoleBasedAuthorizationNETCore

Dynamic Role-Based Authorization in ASP.NET Core 2.0 - mo-esmp/DynamicRoleBasedAuthorizationNETCore

github.com



 

You already know how role-based authorization works in ASP.NET Core but what if you don't want hardcode roles in authorization attribute or create roles later and specify in which controller and action it has access without touching source code?

Introduction

You already know how role-based authorization works in ASP.NET Core.

Hide   Copy Code

[Authorize(Roles = "Administrator")] public class SomeController : Controller { }

But what if you don't want hardcode roles in authorization attribute or create roles later and specify in which controller and action it has access without touching source code?

Using the Code

Let's begin our journey. Create ASP.NET Core Web Application project and change authentication to Individual User Accounts.

 

 

+ Recent posts