views:

26

answers:

0

Howdy,

I'm using the admin site in django. By default there are the user and group models. I enabled to select the groups when creating a new user and I now want to filter the set of assignable groups depending on the current user. E.g. if the user is a superuser he is able to assign all groups. If he's within a subgroup, he can only assign the groups below and so far and so on.

I tried changing the add_form of the Users-ModelAdmin class, but that is for all users (as can be seen here: http://stackoverflow.com/questions/1531065/django-apply-same-parent-constraint-to-manytomanyfield-mapping-to-self). Anyone knows a possibility to make this work?

Thanks in advance! Alex