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
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAExk7p1MWvvv8y62HFvx0unJ5f8%3DP4rS37NMbt7CFFZg2sb3kA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.