I have an ASP.NET MVC project. In this project a user can login to my website. All logged in users go to the same page login page. There is a separate section of my website that is then sectioned off only for certain users. This is defined in the Web.config by the following:
<location path="SectionedOff">
<system.web>
<authorization>
<allow users="user1,user2,user3" />
<deny users="*" />
</authorization>
</system.web>
</location>
If a user is authorized for this section, I want to show a button on the page that everyone is redirected to upon login. Here is a crude paint drawing of what I am trying to accomplish:
I already have authentication done along with proper authorization, I just am not sure how to show and hide this button based off of if the user is authorized for a separate section of the website. I have a sneaking suspicion that I will have to read the Web.config file for this information, however, I can't figure out how to read info in a location in the Web.config. Any help would be appreciated :)