Answer the question
In order to leave comments, you need to log in
How to attach roles to asp.net?
I have an asp.net application running on an intranet. Forms authentication system is used
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" />
</authentication>
Answer the question
In order to leave comments, you need to log in
In general, the casket just opened. The built-in membership still gets into the user-role table, and the account is available by Profile.UserName and Role.UserInRole().
Here is one of the implementations that I have tested. We create all the roles in regular ways + the role that we assign when the user's AD first enters the site. I called her guest. On the master page, I added code that assigns the guest role to the logged-in user.
This creates entries in the "users" and "user-role" tables. That. we get an external user to our database and its connection with the role. It remains only to assign a role with the desired access level.
All.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question