2

How can I make a group in the Django admin panel that can only view the model? I already have one group that can edit, delete and add objects, but I would like to create another one that can only view, search and filter.

Thank you in advance! Would be happy to answer any questions you may have!

Soroush Ghodsi
  • 380
  • 1
  • 7
  • 19
  • 1
    I did this recently, with Django 1.8, based on this answer: http://stackoverflow.com/questions/23104449/view-permissions-in-django There are maybe a couple of bits missing (as the answer is for an old version), but try that and I'll try and help where its missing. – wobbily_col Sep 06 '15 at 18:20
  • In what way does it not solve your problem? I now have an admin site with read-only / view permissions. You need to expalin what you are looking for and what is missning. – wobbily_col Sep 06 '15 at 18:23
  • I want to create a user group that has read-only permission! – Soroush Ghodsi Sep 06 '15 at 18:24
  • Thats what that solution will do. the admin site is not set up for view permissions, so you have to hack it a bit, and thats what the soultion expalains how to do. – wobbily_col Sep 06 '15 at 18:27
  • I will look at the solution more closely, but I just quickly looked at and didn't think it was the right solution for me! Also is there not an easier way to do this? – Soroush Ghodsi Sep 06 '15 at 18:29
  • This is not a particularly easy solution, I agree, and maybe not worth trying unless you know django well. The "easy solution" is to make all field on the admin form readonly. Everything will display as normal but you will get a permission denied error when trying to save. If you want some users will full edit permissions, this way is going to be tricky. – wobbily_col Sep 06 '15 at 18:32

0 Answers0