Question:
I building 2 permission for the user account owner and the apartment owner. Although they have the same code, the user account owner doesn’t work.permissions.py


Answer:
I think the return expression of the first permission class is not correct. It should beobj
, not obj.username
because request.user
is the instance of the User model.If you have better answer, please add a comment about this, thank you!