Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:25:15+00:00 2026-06-02T17:25:15+00:00

I am adding ASP.NET MVC to an existing WebForms application. For the time being,

  • 0

I am adding ASP.NET MVC to an existing WebForms application. For the time being, I don’t care about authentication/logging in, since this part is handled by existing code (Forms authentication).

In the existing WebForms application, we have a fully custom permission-based authorization per page. So each user has a set of rights, listing the pages he is allowed to access.
Now I need to decide how I can use the same permission system to restrict access to specific MVC controllers and actions.

As I understand, for ASP.NET MVC there is a standard AuthorizeAttribute where I can specify roles. I also found some articles which suggest specifying permissions instead of roles – then it’s possible to do something like this:

[CustomAuthorize(Roles = "View products, Edit products")]

By extending AuthorizeAttribute, I can also define how I store and access permissions.

This solution would be acceptable for me (although changing the semantics of roles smells a bit).
But before committing to it, I’d like to see what other options there are. And that’s where I am stuck – I haven’t found a full-blown overview of different approaches on authorization in ASP.NET MVC. I would also like to know how all the security concepts (like Forms Authentication, Membership Providers, Authorization Attribute, IPrincipal, etc.) are related to each other and how they are supposed to work together.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:25:17+00:00Added an answer on June 2, 2026 at 5:25 pm

    First thing you have to understand is that much like Webforms, there is a pipeline in MVC. Each request goes through a number of methods, and there are extension points along the way that you can “hook into” and do things.

    All the AuthorizeAttribute does is hook into the OnAuthorization extension point, and decide whether to give someone access or not based on criteria you have supplied to it (usernames, roles, etc..).

    Here’s an example: http://geekswithblogs.net/brians/archive/2010/07/08/implementing-a-custom-asp.net-mvc-authorization-filter.aspx

    You can create your own custom authorization attribute, and do exactly the same thing with your own criteria. You don’t need to re-purpose the Roles parameter, you can create all your own if you want.

    This is the method that MVC prefers. One other nice thing is that if you also make it a filter, then you can add it to the global filters and have it apply to everything if you want.

    You basically have two other reasonable choices. Implement a handler in global.asax in Application_AuthenticateRequest (not recommended) or create a common BaseController that you override OnAuthorize (the Attribute hooks the same thing, but in a different place).

    Lots of people try to do authentication using Session variables, and that’s just the worst thing to do.

    Since we don’t know anything about your authentication and permission system, all we can do is provide general advice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET WebForms application that I'm adding some ASP.NET MVC to. I
I'm adding some ASP.NET MVC pages to an existing ASP.NET Web Forms project. I've
I have an existing asp.net mvc website that uses basic forms authentication. The site
I've got a basic ASP.NET MVC 2 application. I've got adding and editing rows
I have an ASP.Net MVC 3 web application and I am adding a check
I have an existing ASP .NET MVC application and I would like to ignore
I have an existing ASP.NET MVC 2 application that I've been asked to extend.
I'm using ASP.Net MVC Design pattern and when adding a controller to my application
I'm in the process of adding ASP.NET MVC to a WebForms app. One of
I've a problem with adding jQuery to an ASP.NET MVC application. I add jquery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.