def METHOD_NAME(self, request, *args, **kwargs):
    if not self.check_permissions(request.user):
        self.add_message(_('Insufficient permissions.'), messages.ERROR)
    else:
        action = request.POST.get('action', None)
        if action in self.allowed_actions:
            self.action = action
            self.process_action(action)
            return HttpResponseRedirect(self.get_success_url())
        else:
            self.add_message(_('Action {0} not allowed.').format(action),
                             messages.ERROR)
    return HttpResponseRedirect(self.get_fail_url())