Almabase Blog

A solution to the Django admin view permission

Posted by Almabase on Mar 1, 2016 2:57:25 PM

It's very likely that you've landed here because you're trying to solve the issue of being able to create read only permissions to be used on the admin interface. This is specially needed because a certain user (admin) who has access to edit objects of a model might need read access to another model to be set as foreign key.

 

Once the above mixin and signal handler are in place, first run syncdb to create the view permissions on all content types. Then assign these view permissions without change permissions for a particular model. Ensure that the admin class of that model uses the ReadOnlyAdminMixin. Something like this:

 

Please leave a comment if you have a question and I'll be happy to discuss.