How to get Roles from using SimpleMembership?

后端 未结 2 1912
Happy的楠姐
Happy的楠姐 2021-01-21 16:19

I am developing a MVC4 application with SimpleMembership. I have a table - \"userInfo\" in which I am storing user\'s information such as Name, Email, Address, Phone, Role etc.

2条回答
  •  生来不讨喜
    2021-01-21 16:51

    You can user Roles.GetRolesForUser Method after your user logged in

    Gets a list of the roles that the currently logged-on user is in.

    Or if you want to check whether current user is in specified role you can use Roles.IsUserInRole Method

提交回复
热议问题