Role management in ASP.NET 2.0

G

Guest

I'd like to take advantage of the role management classes in 2.0 to allow my
users to give other users access to their data. For this reason I'd like to
create new roles on-the-fly without having to hard-code them in web.config.

Can I do this by calling Roles.CreateRole?

If yes, how does this wok together with roles defined in web.config?

If no, how can I accomplish the above functionality?

Thanks a'bunch!
 
G

Guest

Bevo,
You are not required to use web.config as the sole place to define roles.
ASP.NET 2.0 supports the Membership and Role provider classes. There is a
built-in implementation of the SqlMembershipProvider and SqlRoleProvider
classes that are designed to work with SQL Server, and there are base classes
from which you can derive your own custom Membership and Role providers.

In this manner, you can create custom roles "on the fly" by adding them to
the appropriate Database tables.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top