code: def has_perm(self, user, perm, obj=None):
          
          if not user.is_active:
              return False
          return perm in self.get_all_permissions(user, obj)
docs: Returns True if the given user has the specified permission.