Hasan Iqbal Anik Hasan Iqbal Anik - 2 years ago 85
Python Question

Django: request.user.user_permissions is always None

I have created a user and assigned it to a group from django admin panel. I have given certain permissions to that group. However, when I catch the request in my view, it seems that the associated user has no permission at all. I'm using JWT web token based authentication system. Any ideas?

Answer Source

user_permissions just contains the permissions explicitly assigned to the user. To also get those that are implicitly assigned as part of group membership, you need to use get_all_permissions().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download