aspnet-core-3-role-based-authorization-api
aspnet-core-3-role-based-authorization-api copied to clipboard
Update UsersController.cs
We should check the requester's rights before making the trip to the db.
Don't you think that would make the code less efficient?
@Berkmann18
Why would checking if you're an admin first and then make a call to the database to retrieve the user, be less efficient? Currently you call the database first (overhead), and THEN check if the user requesting the information is an admin?