Last post Apr 15, 2014 12:34 PM by Suraj A
Apr 14, 2014 04:01 PM|SMDQVTMM|LINK
I have a web application, I need to set assign user role (different users have different roles after they logon). How can I start?
I use ASP.NET and C#.
if you have some examples or reference links, please share.
Apr 14, 2014 04:17 PM|Rion Williams|LINK
Could you elaborate a bit more on the type of Authentication / Authorization that you are using for your application (eg the new ASP.NET Identity or the previous ASP.NET Membership providers?)
For ASP.NET Membership
If you need to handle this assignment yourself and are using Visual Studio 2012, you should be able to handle the assignment of Roles for your users using the ASP.NET Web Site Adminstration Tool to manage members, roles and other authentication and authorization
You should be able to access it under the Project Menu through the following steps :
This should provide you with wizard-like interface that will allow you to easily select users and manage their roles and other properties.
For the Newer ASP.NET Identity
If you needed to handle this for the newer ASP.NET Identity that has been rolled out in newer Visual Studio 2013 applications, then you'll be disappointed to find that the previously mentioned configuration tool no longer exists.
Brock Allen, one of the leading security gurus on this forum, recently released a
tool called IdentityManager designed to add this same functionality that will work with both ASP.NET Identity and his own MembershipReboot library (an improved version of the ASP.NET Identity model) :
If you need some additional information and resources on how Roles are handled within ASP.NET, I would recommend reading through the following tutorials and articles :
Apr 14, 2014 04:20 PM|srigowri|LINK
If you are using Visual Studio , you can use ASP.NET configuration tool to configure users and roles for the application. Click on the Project tab menu to find ASP.NET configuration tool.
Apr 14, 2014 04:47 PM|SMDQVTMM|LINK
I used the default login from ASP.net but I want to grant the users with different roles, like, some users can only view the pages but can not edit, some users even can not browse some pages and admin user can have a full control.
currently, anyone can log/registe a user account and have all permissions.
I tried to publish the application and see what looked like but it failed and see some roles error. I am not sure if it is related my user functions.
Application project is going well but publishing has a lot troubles and have no ideas.
Apr 14, 2014 07:37 PM|SMDQVTMM|LINK
I use VS2010. Is the same as 2012?
Apr 15, 2014 09:25 AM|Rion Williams|LINK
I believe that Visual Studio 2010 also features a similar Configuration tool, it should be under Project > ASP.NET Configuration.
Apr 15, 2014 12:34 PM|Suraj A|LINK
You can use the default membership and role provider provided by asp.net. Set the rolemanager enabled attribute to true in web.config,
Also you can use the role manager API for creating roles or use the inbuilt asp.net configuration tool
refer this link