theactiveactor
theactiveactor

Reputation: 7554

Django admin- constrain visibility of models and model instances based on who logged in

Using the django admin, I would like to be able to specify which models a user sees when he logs in. For a stretch goal, for each model types a user can see, I would like to specify a filter to limit which instances of the model the user can see.

Could someone please provide a pointer for how to go about achieving this?

Upvotes: 0

Views: 379

Answers (2)

Jonathan Livni
Jonathan Livni

Reputation: 107092

You can specify which models the user can see and manipulate using the admin itself. You can do this when you're logged in as a superuser.

Regarding your stretch goal, a simple answer is detailed here.

Upvotes: 1

Steve Jalim
Steve Jalim

Reputation: 12195

Take a look at group-level permissions in the Admin (scroll down). Django 1.2 has introduced hooks for object-level permissions too

Upvotes: 0

Related Questions