Monday, July 27, 2015

Building a UNIX style permissions system in Django

I have a need for a more robust permission system for objects in Django
than the one provided by it in the core distribution.

I want to have users and groups and each to have read, write and edit
permissions but I have no idea how to go about how to implement this.

I was thinking of having a permissions mixin that had three
ManyToManyFields with each of them representing the users that had read,
write and edit permissions but I'm stuck on how to go about implementing
the group permissions.

I basically need to add these fields to the models of objects that I
want permissions for so I was thinking of making them abstract base
models and then having all my other models inherit from them. This
should have the advantage of picking up all the permission based methods
that I can use on objects that make use of the permission system.

Can anyone offer any advice please?

Thanks.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/55B66192.3000707%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment