Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to Assign roles to User while creating their account

i am using asp.net built-in membership and role provider.

In my application Admin Create account for user.

currently i am assigning roles by going to asp.net configuration website.

kindly tell me how to add an extra step of Select Role in creat user account API.

Thanks.

like image 700
Nauman.Khattak Avatar asked Jul 26 '10 09:07

Nauman.Khattak


People also ask

How do I assign a role to a user in AWS?

In the AWS Management Console section, under Delegate console access, choose the IAM role name for the existing IAM role that you want to assign users to. If the role has not yet been created, see Creating a new role. On the Selected role page, under Manage users and groups for this role, choose Add.


1 Answers

Are you just asking how to assign a User to a Role?

Roles.AddUserToRole(userName, roleName);

And to remove a role:

Roles.RemoveUserFromRole(userName, roleName);
like image 128
djdd87 Avatar answered Sep 25 '22 05:09

djdd87