Roles Management

Topics: Developer Forum
Apr 17, 2008 at 4:46 AM
Edited Apr 17, 2008 at 5:21 AM
I was able to successfully move the roles providers over to the default ASP.Net roles and membership providers but I was curious about two things.

1) Is it possible to create a roles without using the ASP.Net configuration website? The N2 interface doesn't seem to allow me to do this.
2) Is it possible to setup authenticated user and anonymous user roles? (I can of course create these roles but they won't actually deny or allow access but they won't do anything until N2 knows how to apply such a role).

Any help would be appreciated.
Apr 17, 2008 at 9:42 AM

It is possible to create a custom RolesProvider. This provider can connect to any (data)source you would like.
It is commonly used to create a provider for an SQL database. ASP.NET has built in support for that.\
Perpahs these resource will help? (hit "View Video")

The first explains what to do to connect the provider to SQL of Active Directory, the second has a tutorial in the form of a video.
If you prefer to use the filesystem authentication of the webserver you can change the <authorization> section in \Edit\web.config or a level up in web.config.
Here is some info on that
Make sure you test the implemented solution!
Apr 17, 2008 at 10:44 PM
Edited Apr 18, 2008 at 5:00 AM
Hi Martijn,
Thank you for replying. I am currently using the built-in ASP.Net SqlMembershipProvider & SqlRoleProvider but I will most likely create my own.
Apr 18, 2008 at 8:40 AM
This will help you set up a clean and very lean provider. All the steps required are in here: