endpoint and controller based authorization

19 Views Asked by At

.net core endpoint and controller based authorization Hi; I have a project and I have both Admins and Members in this project. I call my admin users admin and my member users user. When creating a controller, I have a baseController and I can automatically create crud operations with a few lines of code. If there is a route starting with api/cms in this controller, the role of this endpoint should be admin, and if there is a route starting with api/platform, this endpoint role should be user. How can I provide both controller-based and endpoint-based authorization? enter image description here

AdvertController;

enter image description here

In the controller above GetAdvertsByLanguageCodeList I want the user role to access the method, but I think my controller-based admin privilege is disrupting this.

0

There are 0 best solutions below