def get(self, request, *args, **kwargs):
user_has_validation_string = self.get_object().validationString<EOL>user_has_permissions = request.user.has_perm('<STR_LIT>')<EOL>if request.GET.get('<STR_LIT:v>', None) == user_has_validation_string or user_has_permissions:<EOL><INDENT>return super(ViewInvoiceView, self).get(request, *args, **kwargs)<EOL><DEDENT>return self.handle_no_permission()<EOL>
Invoices can be viewed only if the validation string is provided, unless
the user is logged in and has view_all_invoice permissions