From 9ddcf65928e1829681c3cf5e297a94478e3653bf Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 21 Jan 2024 10:45:58 +0100 Subject: [PATCH] Disallow anonymously blocking yourself --- app/views/actions/_question.html.haml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/actions/_question.html.haml b/app/views/actions/_question.html.haml index c96e99a9..504e3e2c 100644 --- a/app/views/actions/_question.html.haml +++ b/app/views/actions/_question.html.haml @@ -8,9 +8,10 @@ %i.fa.fa-fw.fa-exclamation-triangle = t("voc.report") - if question.anonymous? && !question.generated? - = button_to anonymous_block_path, method: :post, params: { question: question.id }, class: "dropdown-item" do - %i.fa.fa-fw.fa-minus-circle - = t("voc.block") + - unless question.user == current_user + = button_to anonymous_block_path, method: :post, params: { question: question.id }, class: "dropdown-item" do + %i.fa.fa-fw.fa-minus-circle + = t("voc.block") - if current_user.mod? = button_to anonymous_block_path, method: :post, params: { question: question.id, global: true }, class: "dropdown-item" do %i.fas.fa-fw.fa-user-slash