I’m building a Leave Request system.
The code was originally downloaded from MS Azure with the ability for 2 factor authentication and I'm adding to that Azure machine generated code.
I got the code from the Quickstart section of my application in Azure ( Quickstart: ASP.NET web app that signs in Azure AD users). In step 2, Azure allows you to download the project with a button to download the code sample which is configured and ready to run.
I want to be able to differentiate users whether they are employees, supervisors, human resources employee, or human resources supervisor. That might change. The point is, I need to display different functionality for different positions.
The way I’m thinking about it now is to get the user (something like User.Identity.Name) and then look them up in Active Directory or Azure AD and then based on whatever attributes I’m looking for, add however many conditional statements to present the required functionality.
However, that seems like a brute-force, old-fashioned way of doing it. It seems like .NET would already have a way built-in to deal with that sort of thing but when I search, nothing relevant comes up (or maybe it was relevant and I misunderstood.)
So, is there any built-in way that .NET can differentiate functionality based on user attributes, or do I need to implement that brute-force approach? How is this best done?