How does the Roles system in Identity work with Web forms?

Posted on 2014-08-09
Last Modified: 2014-08-11
I would like to see samples of how the roles system works with Web Forms in the new Identity system.  All I can find are MVC samples,  absolutely nothing with Web Forms.  I Would like to know, how to set the roles restrictions in folders, and prevent access to specific pages?  Does it work the way it has always worked,  you set folder permissions in the webcconfig in each directory?

I Appreciate the help,
Question by:bmanmike39
    LVL 19

    Accepted Solution

    Please refer to this link:

    So, some things:

    You need a role manager. ASP .NET provides one for us that you can tie into, but I prefer to roll my own. Simply create a class the implements the RoleProvider base class.  All you really, really need to implement is one Method: IsInRole(..) (I think that's it).

    Then, tie the new RoleProvider you created into the application via the web.config, as described in the article. Then, create your roles and assign them to the users in any way you want. The IsInRole() method will check using the process you created.

    I actually did this by using the ApplicationState as the Role holder. I put the username and role in the Application State when they log in. Then, I check the Application State when IsInRole is processed.

    Author Closing Comment


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now