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

  • Home
  • SEARCH
  • 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 4023432
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:35:52+00:00 2026-05-20T10:35:52+00:00

If I have data which I only want to assign to users who have

  • 0

If I have data which I only want to assign to users who have an admin role, how would I represent this in the db schema? i.e. I have a users table, roles table, user_roles table and this particular user is linked to an admin role. How would I then be able to specify information only for admin users?

  • 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-20T10:35:53+00:00Added an answer on May 20, 2026 at 10:35 am

    EDIT4: So if I understand, you have the users table, role table and an association linking users to roles.

    One idea would be to put the value in the role table, then basically you’ll have multiple role for multiple admin levels.

    Or you can create other fields in the association table, to parametrize the association, but that would impact all other association. (or ou can have : X is in group B with option1=1, option2=42, option3=NULL and treat options fields differently depending on the group)

    Other idea, but I would have made it completely differently:

    you treat groups as users, with a special field call isGroup [True/False]. Then you create the groupAssociation table which stores which user belongs to which group.

    Example :

    USER
    --Id--    --IsGroup--
    A         False
    B         False
    C         True
    D         True
    
    GROUPASSOCIATION
    --uid--   --BelongsTo--
    A          C
    B          D
    C          D
    

    Note that you can cascade saying that C is included in D.
    Then you create a privilege table and associate groups or user to certain privileges.

    PRIVILEGE
    --Id--    --Name--
    1         Access Area 1
    2         Access Area 2
    3         Modify user
    4         Edit on StackOverflow
    
    PRIVILEGEASSOCIATION
    --uid--   --pid--
    A         4
    C         2
    D         1
    C         3
    

    So user A would have all privileges (one direct, two from C group, one for D group since C is included in D) and B would have only one (from group D)

    Would it be better in your case?


    EDIT3: Given your last comment, this in not valid anymore
    The GRANT command will help you sort out your problem.

    You can see it right there : GRANT

    As an example :

    GRANT SELECT ON db2.invoice TO 'jeffrey'@'localhost';
    

    You can do it for a column only, for all table, or all database as well

    EDIT: Oh well, let me check for groups. I forgot that part.

    EDIT2: I didn’t see anything about group permission tuning in MySQL : this said it’s not possible but it’s quite old. But I came accros this other SO question and they are using PHP to manage the groups.

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

Sidebar

Related Questions

I have created an archive table which will store data for selecting only. Daily
I want to dump mysql database only the tables which have data, Can u
I have some measurement data which I want to plot. I plot only the
i have two data classes which hold only data members(no functions). One is CallTask
I am getting JSON string from website. I have data which looks like this
I have some data (which users input using WYSIWYG editor). I have created a
I have some data which I am binding to a dropdown dynamically like this:
I have the following question: I have data frame which looks like this. I
I have CSV data file contained follow info: -0.2500000000,15, 15;15;15;15;15;15;15;15;15;15;15;15;15;15;15;15;15;0;0;0;0;0;15;0;0 ,0,0 I only want
I have a list of read only data which are a bunch of end

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.