views:

125

answers:

1

i am using the asp.net membership that ships with asp.net-mvc sample app. how do i set certain users up as an Admin role versus a regular Member role?

+2  A: 

I suppose the way is like Asp.NET WebForms:

Roles.AddUserToRole(User.Identity.Name, selectedRole)

Take a look here http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/security/Add_Delete_UserRoles.src and here http://quickstarts.asp.net/quickstartv20/aspnet/doc/security/membership.aspx for samples.

m.bagattini