In the membership provider there are mechanics to provide athentication and authorization at the page level using the web.config files and protection for methods using decorators.
I am pretty new to using this asp.net http://msdn.microsoft.com/en-us/library/yh26yfzy(v=VS.90).aspx
My question is, is there a method to NOT store these in .config files and code but to have them in the sql database so that administration can be managed to allow multiple "roles" and security in some dynamic fashion?
Examples of what I mean:
web.config file:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<authorization>
<allow roles="Administrators" />
<deny users="*"/>
</authorization>
</system.web>
</configuration>
Example snip of a method decorated:
[PrincipalPermission(SecurityAction.Demand, Role = "Administrators")]
[PrincipalPermission(SecurityAction.Demand, Role = "Supervisors")]
protected void UserGrid_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
In particular, I would be interested in examples where a database Party data model pattern/practice could be used to facilitate both the authorization but also the authentication of a particular user and not have the roles and such defined in the configuration or code. Am I missing something that I should know/be aware of here?