I'm using Forms Authentication and I want to restrict certain pages to certain roles. Right now everyone has access to the entire application once logged in.
But I'd like to restrict certain pages to certain roles. For example, the "view logs" page.
I'm thinking that my web.config file should look like this:
<location path="logs/view/">
<system.web>
<authorization>
<allow roles="super, admin"/>
</authorization>
</system.web>
But my issue is that, the way the underlying application is built, when user logs in successfully via an api call I am returned a "User" onbject and that user's role is part of that object (User.Role == "admin"). I don't really have a reference database table that tells the APP what role a user has.
How can I associate the
<allow roles="super, admin"/>
bit in my webconfig to the role property of the User object?