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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:22:24+00:00 2026-05-28T06:22:24+00:00

This is the basic database structure for Users and UserRoles. My client wants to

  • 0

This is the basic database structure for Users and UserRoles.

enter image description here

My client wants to be able to look at a Role and tick some boxes, “This role can do x, y and z”. X, Y and Z being some actions in the application.

This isn’t a new idea, and I’m sure there is a proven pattern for this situation. Similar to what WordPress does, it selects functions a role Foo can perform, and a User belongs to that Role.

Any suggestions on an MVC3 specific solution?

  • 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-28T06:22:25+00:00Added an answer on May 28, 2026 at 6:22 am

    The built in Attribute [Authorize] lets you restrict certain actions so that can be only performed by certain roles.

    For what you are trying to, I’d suggest that treat ‘Functions X,Y and Z’ as the roles, and that you treat what you currently have as roles as ‘user groups’ or something. So, your client then would be able to assign different ‘User Groups’ access to certain ‘Roles’.

    This way you could make use of the built in membership/role/authorization stuff. all you’d need to do was implement your own MembershipProvider and RoleProvider.

    Your role providers implementation of string[] GetRolesForUser(string username) would need to do a database look up to see what ‘User group(s)’ they are in, and therefore which ‘Role(s)’ they have access to.

    If you do that, you can easily restrict access to the different functions via the [Authorize] attribute, and use the standard membership stuff for handling the login process.

    If your client insists on calling them ‘Roles’ and ‘Functions’ rather than ‘User Groups’ and ‘Roles’ – you don’t need to tell him that this is not quite how you’ve implemented it 🙂

    Edit

    Alternatively, you can create your own Authorization attibute, just derive from AuthorizeAttribute, and override AuthorizeCore( HttpContextBase httpContext) return true or false if the user is in a role permitted do do function ‘X’

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

Sidebar

Related Questions

I am wanting to do some basic version control with my mysql database structure.
This might be basic question, however I am confused on some .Net Concpets. I
I'm doing some work for a department that has a pretty basic table structure
(Note: I realize this is close to How do you document your database structure?
I'd like to automatically generate database scripts on a regular basis. Is this possible.
I've created this basic 3D Demo using OpenGL/SDL. I handled the keyboard callback so
Forgive my ignorance in asking this basic question but I've become so used to
I'm trying to learn this basic thing about processors that should be taught in
This is basic stuff, but I'm somewhat unfamiliar with VBA and the Word/Access object
I am new to Scala, just started learning, so this is basic beginner question.

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.