diff --git a/packages/ui-default/templates/components/comments_solution.html b/packages/ui-default/templates/components/comments_solution.html
index aa0d4203d..593ce15c1 100644
--- a/packages/ui-default/templates/components/comments_solution.html
+++ b/packages/ui-default/templates/components/comments_solution.html
@@ -142,12 +142,12 @@
{% if handler.user.hasPerm(reply_post_perm) %}
{% endif %}
- {% if (handler.user.hasPerm(reply_edit_self_perm) and handler.user.own(doc)) or handler.user.hasPerm(reply_edit_perm) %}
+ {% if (handler.user.hasPerm(reply_edit_self_perm) and handler.user.own(rdoc)) or handler.user.hasPerm(reply_edit_perm) %}
{% endif %}
- {% if (handler.user.hasPerm(reply_delete_self_perm) and handler.user.own(doc)) or handler.user.hasPerm(reply_delete_perm) %}
+ {% if (handler.user.hasPerm(reply_delete_self_perm) and handler.user.own(rdoc)) or handler.user.hasPerm(reply_delete_perm) %}