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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:28:29+00:00 2026-06-05T10:28:29+00:00

Projects such as Django-guardian and django-permissions enables you to have object level permissions. However,

  • 0

Projects such as Django-guardian and django-permissions enables you to have object level permissions. However, if two objects are related to each other by a parent-child relationship, is there any way for the child object to inherit permission from the parent object unless otherwise specified? For instance, a subfolder should inherit permission from parent folder unless a user explicitly assigns a different permission for the subfolder.

What’s the best way to accomplish this using Django, in particular, the Django-guardian module?

  • 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-06-05T10:28:30+00:00Added an answer on June 5, 2026 at 10:28 am

    When you check if a user has permissions on an object, and doesn’t, then you can check if it has permission on its parent.

    You might even want to make your own function, for example:

    def your_has_perm(user, perm, obj):
        has = user.has_perm(perm, obj)
    
        if not has and hasattr(obj, 'parent'):
            return your_has_perm(user, perm, obj.parent)
    
        return has
    

    This should traverse parents until it finds a permission for a parent or return False.

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

Sidebar

Related Questions

I have two Django Projects where I use a lot of common models. Custom
I'm running wamp on Vista (Apache v2.2.11) and have projects setup such that http://localhost/projectx
I frequently have svn-based projects that include third-party components such as the TinyMCE (in-browser
When I get an error like: $ ls /var/django-projects/daks/public/media/uploads/bandsaws/sneaks.jpg ls: /var/django-projects/daks/public/media/uploads/bandsaws/sneaks.jpg: No such file
What options are there for installing Django such that multiple users (each with an
Is it typical to separate input validation from model-level validation in Django projects? For
I frequently end up with projects containing idioms such as Category has_many Products. I
I found only one attempt to create such compiler - http://sourceforge.net/projects/xsltc/ . But this
I have a constructor for a window in my project setup such that it
i have such code var prj = _dataContext.Project.FirstOrDefault(p => p.isPopular == true); if (prj

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.