Alex Gordon
Alex Gordon

Reputation: 60751

manually adding users to roles in asp.net

i have googled the heck out of this and i cannot find a solution. i would like to add users to a role manually using the administration tool or just manually doing this. i am a beginner with asp.net, how would i do this? i am using windows authentication

Upvotes: 0

Views: 707

Answers (2)

sh.e.salh
sh.e.salh

Reputation: 529

Using ASP.NET authentication

  • open website administration tool .
  • click on security. click manage users.
  • click on edit role beside the username and you will see a list of available roles. enter image description here

if you can't find any users then you have to choose create user first. if you can't find any roles then go back to security and click enable roles then create new role first and repeat the above steps after complition.

for windows authentication you can check for a certain user in code as follow

•Use the IPrincipal interface of the User object attached to the current HTTP request.

if(User.IsInRole(@"DomainName\Manager")) // Perform restricted operation else // Return unauthorized access error.

but any group managment mut be done using windows managment (users and groups) for more info. http://msdn.microsoft.com/en-us/library/ff647405.aspx

Upvotes: 0

emre nevayeshirazi
emre nevayeshirazi

Reputation: 19241

If you are using Visual Studio as and IDE. Click Project Tab and select ASP.NET Configuration. From there click Security to manage accounts and roles.

Upvotes: 1

Related Questions