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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:13:30+00:00 2026-05-14T01:13:30+00:00

I am trying to find a good pattern to use for user access validation.

  • 0

I am trying to find a good pattern to use for user access validation.

Basically on a webforms application I had a framework which used user roles to define access, ie, users were assigned into roles, and “pages” were granted access to a page. I had a table in the database with all the pages listed in it. Pages could have child pages that got their access inherited from the parent.

When defining access, I assigned the roles access to the pages. Users in the role then had access to the pages. It is fairly simple to manage as well. The way I implemented this was on a base class that every page inherited. On pageload/init I would check the page url and validate access and act appropriately.

However I am now working on a MVC application and need to implement something similar, however I can’t find a good way to make my previous solution work. Purely because I don’t have static pages as url paths. Also I am not sure how best to approach this as I now have controllers rather then aspx pages.

I have looked at the MVCSitemapprovider, but that does not work off a database, it needs a sitemap file. I need control of changing user persmissions on the fly.

Any thoughts/suggestions/pointers would be greatly appreciated.

  • 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-05-14T01:13:30+00:00Added an answer on May 14, 2026 at 1:13 am

    Your technique is easily accomplished by creating your own ActionFilter:
    http://msdn.microsoft.com/en-us/library/dd410056.aspx

    You can then apply this attribute to controllers or action methods and roll your own page security very easily.

    public class MinmalSecurity : ActionFilterAttribute
    {
        private string _roles;
        public MinmalSecurity(string roles)
        {
            _roles = roles;
        }
    
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            //go to database,find permissions, redirect or proceed as nescessary
    
            base.OnActionExecuting(filterContext);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to find a good library to use for an android graph.
I'm trying to find a good way to do field validation in a WebObjects
I'm trying to find a good way to get a Scanner to use a
I'm trying to find a good example of how to use these binary wide
I've had a hard time trying to find good examples of how to manage
I'm currently trying to find good way to make calls to WCF services in
Hey, as of lately, I've been trying to find good ways to smoothen out
Trying to find a good name for a method swapping each coordinate X and
I'm trying to find a good, current css3 gradient reference, including vendor prefixes. I've
I'm trying to find a good way to handle the following scenario (I'm still

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.