Django Permission

Refresh

March 2019

Views

4 time

0

Hi i am having trouble with Django User object.

I have created a group named 'Admin' and this group have the following permission 'can_change_name','can_update_name'.

A user 'falcon' belong to group 'Admin' i did this by performing the following query

user.groups.add(Group.objects.get(name='Admin))

When i perform the following query i am getting False instead of True.

user.has_perm('can_change_name') 

The above query give me False, i have a doubt why i am getting False even after adding the user into the appropriate group.

0 answers