It's an extremely nice article about how to implement the Role-based Authorization in Net Core Web API. I won't copy it here because it's written to good. Maybe I will publish to Git a template app later, but now just save for future.

It's actual for Net Core 6, 7, 8

https://jasonwatmore.com/post/2022/02/18/net-6-role-based-authorization-tutorial-with-example-api#role-cs