djangodjango-admin

User permissions on proxy models in modeladmin


When using a proxy model:

class Uf(models.Model):
...

class CustomUf(Uf):
    class Meta:
        proxy = True

class CustomUfAdmin(admin.ModelAdmin)

admin.site.register(CustomUf, CustomUfAdmin)

It seems like only superusers can access the CustomUf through admin site... I can't figure out how to grant permissions on CustomUf to regular users...


Solution

  • Ok, Chris remark about content types gave me the hint...

    I made the mistake to define the proxy object in "admin.py". This way, you have to be superadmin to access it.

    If I define the proxy object in models.py, then the content type appears and everything works fine...