Hi !
Is it possible to force a model to appear on the admin index page depending on the request ?
I'm asking because I did override the has_change_permission() method of the ModelAdmin, so that the user can be allowed to change some instances (chosen via a ManyToMany relationship between the user and the instances).
So, the idea is (in pseudocode):
if user.has_permission( change_permission ):
he can manage all the instances -> display the model in the admin
else:
if user.allowed_instances.count()>0:
he can manage some instances -> display the model in the admin
else:
he cannot manage any instances -> do not display the model in the admin
Thanks !!
Olivier