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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:50:01+00:00 2026-05-23T22:50:01+00:00

I have a standard many-to-many relationship in my database between Person and Widget. A

  • 0

I have a standard many-to-many relationship in my database between Person and Widget. A Person in an administrative role has access to ALL Widgets. In my application, I want to see which Widgets a Person has access to.

I have two high level options:

  1. Explicitly manage the relationships. When a Person becomes an administrator, relate that Person to all existing Widgets. When a Widget is created, relate that Widget to all existing administrators.

  2. At run-time, if the Person is an administrator, assume they have access to ALL widgets and bypass the relationship table when loading Widgets.

Is one option better than the other? Is there a name for this scenario?

I have been trying to apply option 2 using NHibernate and I can’t seem to figure out how to get it to bypass the relationship table when loading all Widgets for an entity (and even if I could, this would unnecessarily load alot of information unless I load Widgets separately from the Person entity and apply paging).

  • 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-23T22:50:02+00:00Added an answer on May 23, 2026 at 10:50 pm

    I would map this by means of Roles.

    Roles : Person = 1 : Many

    So when you create a person, you also create a new Role, unless they are an Administrator in which case they use the existing Admin Role.

    Then the problem is easy: You need a WidgetRole table.

    When a new Widget is created, and entry is automatically added to the WidgetRole table for NewWidget, AdminRole

    When a Person changes to an Admin Role, simply change their current Role.

    imo this setup is logically simpler, than having a special Admin case.

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

Sidebar

Related Questions

I have a standard many-to-many relationship between users and roles in my Rails app:
I have a pretty standard setup, with a many-to-many relationship between Departments and Employees.
I have a standard many to many relationship between two tables, linked using a
In my Rails app I have a fairly standard has_many relationship between two entities.
I have a many to many relationship between student and classes . I created
I'm writting an application that has many Ajax widgets (Kendo-UI to be percise). It's
Let's assume I have two models: A and B. A has one-to-many relationship with
I have an Employee class which has a unidirectional many to many relationship with
Using CoreData, I have an entity Bookmark, that has an to-many relationship named 'tags'
Using Postgres v. 8.4.2. I have a standard three-table setup for a many-to-many relationship.

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.