1

I'm currently working on a Django project which will be available to use by several companies and their particular data about their clients.

My question is if it is possible to adjust Django admin panel somehow, so that any user could log in (in this case the particular company worker) and have an access to admin tools, but only for the data related to his company (in this case the company clients)?

Example: Worker of company X logs in and checks status of clients of his company, changes some data etc. At the same time worker of company Y logs in and does the same work with the clients related only to company Y. Both users see only clients related to their own company - they don't have access to other company's data.

I've found something like this, but I'm not sure if it's appropriate to my situation :P

Mateusz
  • 23
  • 4
  • The code suggested in the first answer that you linked to could work, but the warning they give is a BIG warning and going down this route will have long-term consequences as you continue to develop your Django project. I would suggest creating your own views for these users so that you retain full functionality of the Admin for your purposes and can customize their experience for their specific use case – grrrrrr Feb 26 '19 at 15:55

1 Answers1

0

I think the thread you linked is pretty much what you want to do :)

I had to do something similar (role based filtering of displayed objects) and was also overriding the get_queryset method in order to achieve what I had to.

I think the accepted answer in that thread gives a pretty good overview of how to approach it.

platzhersh
  • 1,520
  • 20
  • 35