class MyView(UserPassesTestMixin, View):

    def test_func(self):
        return has_add_permission(self.request.user, self.request)
How to pass Django request object in user_passes_test decorator callable function