As stated here with every call of python manage.py migrate
the default permissions are created for new models.
What could be the reason that permissions are not created for classes from a certain models.py?
These are classes that were created normally (with models.Model). If you want to assign permissions to individual users for these models in django-admin, exactly these models do not show up.
In an associated admin.py the models were registered with @admin.register() for the admin-backend.
The real problem is that administrators see these classes/models in their backend and are able to edit them. A part of the users (which belongs to the group staff) should also see these models, but not be able to edit them. However, since permissions cannot be assigned to users or user groups in Django admin (and they don’t show up when getting all permissions via Permission.objects.all()), this fails.
Also adding default permissions to the classes Meta and running migrate
does not change a thing.
Does anyone have any ideas?