ivanpaulovich / hexagonal-architecture-acerola

An Hexagonal Architecture service template with DDD, CQRS, TDD and SOLID using .NET Core 2.0. All small features are testable and could be mocked. Adapters could be mocked or exchanged.
http://paulovich.net/acerola/
Apache License 2.0
460 stars 99 forks source link

Role Based Apis #13

Open MuhammadAhmed8 opened 2 years ago

MuhammadAhmed8 commented 2 years ago

If the same resource can be accessed by different roles and perhaps differently, where to place that logic. For example, a manager can make any customer account inactive but a customer can only make his/her account inactive. What is better to have a separate for both roles, or a single api /account?customerId=1 and have a if/else inside the controller or domain rule. There can be multiple roles in the real case. What do you prefer?