Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I recommend you to go with Django-guardian. </p> <ol> <li><p><a href="http://packages.python.org/django-guardian/" rel="nofollow noreferrer"><strong>Django-guardian</strong></a></p> <p>Great, <a href="https://encrypted.google.com/url?url=https://docs.djangoproject.com/en/dev/misc/design-philosophies/?from=olddocs#don-t-repeat-yourself-dry&amp;rct=j&amp;q=django%20DTY&amp;usg=AFQjCNH15DvRkmvno6LUBcatSK8txTbSeg&amp;sa=X&amp;ei=R-q3TpvrJIWgOrneyYIC&amp;ved=0CB8QygQwAA&amp;cad=rja" rel="nofollow noreferrer">DRY</a>, maintained and well-tested app, that solves the issue. As of today, this is the <strong>most maintained and <a href="https://github.com/lukaszb/django-guardian" rel="nofollow noreferrer">actively developed</a></strong> library for implementing per-object permissions.</p> <p>We are currently using <strong>django-guardian</strong> in one of our big projects and are very pleased with stability and functionality. </p> <p>Django-guardian source code is very simple and easy to understand because it is built upon the permission code in Django core. </p> <p>However, there is a minor issue with <a href="https://code.djangoproject.com/ticket/11154" rel="nofollow noreferrer">Django permissions for proxy models</a> which is not fixed in Django core thus making it really tricky to set permissions (global and per-object alike) for them. One of the ways to overcome this is to declare all permissions in a non-proxy object and query for them every time when you need to check for permission to access a proxy model.</p></li> <li><p><a href="http://code.osuosl.org/projects/object-permissions" rel="nofollow noreferrer"><strong>Per-object permission library by OSU Open Source Lab</strong></a></p> <p>It is more of a standalone application than Django-guardian and supports older versions of Django. This app is relatively well maintained. (I personally haven't used it.)</p></li> <li><p><strong><a href="https://stackoverflow.com/questions/2821997/django-1-2-object-level-permissions-third-party-solutions">Other solutions form older posts</a></strong>.</p> <p>But most of them are poorly maintained. </p></li> </ol> <p><em>Of course, if you need to implement only a few minor checks, row-level permissions are overkill, just like <a href="https://stackoverflow.com/questions/8037402/django-permissions-code-ourselves-or-use-app#answer-8037637">Andrey said</a>.</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload