[Solved]-Django 1.2 object level permissions – third party solutions?

7👍

Finally, I found really good stuff: Florian Apolloner wrote a howto on djangoadvent: http://djangoadvent.com/1.2/object-permissions/
Now that’s what I’m gonna use 🙂

Something useful might be as well: http://github.com/washingtontimes/django-objectpermissions (link dead as of 2011-07-18)

9👍

I used https://github.com/lukaszb/django-guardian when it was still in version 0.2 on a project and it was rather complete and bug free.

Yes I did have to write my own ‘check_permission’ view decorator as at the time it didn’t have it included yet – but at least from version 1.0 it is there.

The author was also very quick to respond to an issue I had migrating from 0.2 – overall I’ve been happy with it and hence made it part of my project skeleton template.

5👍

I have released a Django-app called django-rules which lets you manage per object permissions in a flexible, dynamic and scalable way. You might want to check it out.

1👍

I tried using django-granular-permissions for a site a while ago, but was unable to get it to do what I needed (this may have been my own inability to understand what I needed to do rather than the app). Looking at the google code site’s updates tab, it looks to not have had any work done on it since Summer/Autumn last year so it may be another dead duck.

👤Amos

1👍

OSU Open Source Labs has an implementation of object level permissions here

1👍

First of all, the main source of information is djangopackages.com’s perms grid: “A grid of all packages implementing permissions for users and groups in your Django project”. (Beware some packages are named very similarly, e.g. an ‘s’ or a dash is the only difference)

Then, reviewing each package features (considering only the somewhat-actively maintained subset), these are the main candidates:

  • django-guardian: “implementation of per object permissions as authorization backend which is supported since Django 1.2.”
    pypi, repo, docs.

  • django-permissions: “Generic per-object permissions for Django”. “django-permissions provides per-object permissions for Django on roles”.
    pypi, original repo, most updated fork, docs.

  • django-authority: “provides generic per-object-permissions for Django’s auth app.” “Django app for per-object-permissions that includes a bunch of helpers to create custom permission checks.”
    pypi, original repo, most updated fork, docs.

There are others that for one reason or the other did not make the cut:

PS: This answer was written according to the current state of open source packages, more than 2 years after the question was asked. Although not too thorough, I hope this work will help those that are in the same situation I was.

Leave a comment