문제

When I create a user in Django, he has no permissions:

In [7]: u = User.objects.create(username='aoeu')
In [12]: u.user_permissions.all()
Out[12]: []

I want some permissions to be set by default (say, 'api.add_item'), and I use Django Guardian. Is this possible to do in a declarative way, eg. without writing a post_save signal?

도움이 되었습니까?

해결책

No, it is not possible. Check django.contrib.auth code to ensure

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top