Reputation: 13
I have models that belong to some 'group' (Company class). I want to add users, who will also belong to a one group and should be able to edit/manage/add objects with membership in associated group.
something like:
class Company()
class Something()
company = ForeignKey(Company)
user Microsoft_admin
company = ForeignKey(Company)
and this user should only see and edit objects belonging to associated Company in the Admin Interface.
How to acomplish that?
Upvotes: 1
Views: 2184
Reputation: 12978
I'd say this has been satisfyingly answered in How can I implement a global, implicit filter in Django admin?
Upvotes: 0
Reputation: 3465
There are a few different ways to do it. The magic words that you're looking for are "row level permissions". Search for that and "Django" and you should find what you're looking for.
Beyond a certain point though, it's easier to roll your own views. It all depends on your use case, and what exactly you're trying to achieve.
Upvotes: 0