locked
reference for user role in asp application RRS feed

  • Question

  • User-19719568 posted

    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.

    Thanks

    Monday, April 14, 2014 4:01 PM

Answers

  • User281315223 posted

    I believe that Visual Studio 2010 also features a similar Configuration tool, it should be under Project > ASP.NET Configuration.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 15, 2014 9:25 AM
  • User2007645713 posted

    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 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 15, 2014 12:34 PM

All replies

  • User281315223 posted

    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 information.

    You should be able to access it under the Project Menu through the following steps : 

    1. Click on your Project within the Solutions Explorer.
    2. Select Project from the menu within Visual Studio 2012.
    3. Choose the ASP.NET Configuration option at the very bottom.

    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 :

    Monday, April 14, 2014 4:17 PM
  • User1068970394 posted

    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.

     

     

    Monday, April 14, 2014 4:20 PM
  • User-19719568 posted

    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.

    Thanks.

    Monday, April 14, 2014 4:47 PM
  • User-19719568 posted

    I use VS2010. Is the same as 2012?

    Thanks

    Monday, April 14, 2014 7:37 PM
  • User281315223 posted

    I believe that Visual Studio 2010 also features a similar Configuration tool, it should be under Project > ASP.NET Configuration.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 15, 2014 9:25 AM
  • User2007645713 posted

    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 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 15, 2014 12:34 PM