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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:38:57+00:00 2026-05-15T22:38:57+00:00

This is a tricky question, we’ve been talking about this for a while (days)

  • 0

This is a tricky question, we’ve been talking about this for a while (days) and haven’t found a convincingly good solution. This is the situation:

  • We have users and groups. A user can belong to many groups (many to many relation)
  • There are certain parts of the site that need access control, but:
  • There are certain ROWS of certain tables that need access control, ie. a certain user (or certain group) should not be able to delete a certain row, but other rows of the same table could have a different permission setting for that user (or group)

Is there an easy way to acomplish this? Are we missing something?

We need to implement this in python (if that’s any help).

  • 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-15T22:38:58+00:00Added an answer on May 15, 2026 at 10:38 pm

    1)create a table with rights, ie delete, update, etc

    2)create a three way pivot table on the rights table, whatever table you want row level access for and whatever table contains the unit of access rights (either group or user).

    3) check for a relationship in the pivot table before you allow the operation to proceed.

    your rights table could look like:

    ID   RIGHT
    1    DELETE
    2    UPDATE
    

    the table that you want row level access control for could look like (say a blog for example):

    ID  TITLE           CONTENT
    1   blog entry 1    This is a blog entry
    2   blog entry 2    This is another blog entry
    

    and your user table could be:

    ID   NAME
    1    Bob
    2    Alice
    

    Then the pivot table would be like

    ID USER_ID RIGHT_ID BLOG_ID
    1  1       2        1
    2  2       1        1
    3  2       2        1
    4  2       1        2
    5  2       2        2
    

    This means that Bob can only update blog entry 1 but Alice can update or delete either blog entry

    EDIT: If you want a right to come from the user or the group then you need two pivot tables for each table; one for users and one for groups. You will also have to query the database to check for user level rights and group level rights before you allow or disallow an operation

    EDIT2: This is more complicated than David’s solution but doesn’t require you to compose permission_classes ahead of time: you can mix and match whatever group level and user level permissions you want which is what it seems like you want to do.

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

Sidebar

Related Questions

This one's been tricky to quantify, so I may not have this question worded
i find this question tricky but what files store method signature info for xml
This is a slightly tricky question. I am using NSDateFormatter on the iPhone but
I find this question a little tricky. Maybe someone knows an approach to answer
This is a tricky question to ask. A friend of mine seeks help, and
Tricky question for a bash noob like me, but i'm sure this this easier
This sounds like a tricky question... let me ellaborate... I have a treeView. When
NOTE: This question is tricky (to decide whether it pertains to SO or not),
Although this question have been asked and answered before, including on this website, I
I read that this is a tricky question because an applet is run in

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.