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 8505043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:12:28+00:00 2026-06-11T02:12:28+00:00

Possible Duplicate: ASP.NET MVC3 Role and Permission Management -> With Runtime Permission Assignment Say

  • 0

Possible Duplicate:
ASP.NET MVC3 Role and Permission Management -> With Runtime Permission Assignment

Say I have an ActionResult Members in a controller that should only allow members to access it. Normally I would just put a [Authorize(Roles = "Members")] attribute on the action to only allow authenticated users in the Members role to access it.

Is there a way I can allow admins (or whatever) to change it in the future to lets say [Authorize(Roles = "Members, PotentialMembers ")] (this would allow users in the roles Members and PotentialMembers to access this action?

Thanks

  • 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-11T02:12:30+00:00Added an answer on June 11, 2026 at 2:12 am

    You can’t, unfortunately, do this with the default attribute. You could, however, write your own attribute by inheriting from Authorize (or you can readily get the source for Authorize on the web).

    From there, you would have to devise a mechanism for a) storing the allowed roles per controller through some kind of interface, and b) using those mappings in your custom filter attribute to allow/deny access.

    If you were to do this, I would recommend loading the mapping at application start up and using an in-memory manager to signal configuration changes.

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

Sidebar

Related Questions

Possible Duplicate: ASP.NET MVC3 how to excute action method of controller using timer with
Possible Duplicate: Schedule Controls for ASP.Net MVC I have MVC3 in which I want
Possible Duplicate: ASP.Net:Best way to run scheduled tasks I have to make a scheduled
Possible Duplicate: Read Post Data submitted to ASP.Net Form I have a google checkout
Possible Duplicate: Multiple forms on ASP.NET page i have a doubt. can we place
Possible Duplicate: ASP.NET postback with JavaScript I have a page without a form. But
Possible Duplicate: Why does ASP.NET auto-generated .designer code have the incorrect type? On my
Possible Duplicate: Use Visual Studio web.config transform for debugging I have an asp.net application
Possible Duplicate: How do I publish a Asp.net web application using MSBuild? I have
Possible Duplicate: Caching in asp.net-mvc i have an asp.net-mvc site and i am running

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.