aspnet-core-3-role-based-authorization-api icon indicating copy to clipboard operation
aspnet-core-3-role-based-authorization-api copied to clipboard

Update UsersController.cs

Open Bygonaut opened this issue 6 years ago • 1 comments

We should check the requester's rights before making the trip to the db.

Bygonaut avatar Oct 16 '19 00:10 Bygonaut

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?

AcidRaZor avatar Aug 18 '20 00:08 AcidRaZor