diff --git a/packages/ui-default/templates/partials/problem_sidebar_normal.html b/packages/ui-default/templates/partials/problem_sidebar_normal.html index 4e4f74668..ced017d35 100644 --- a/packages/ui-default/templates/partials/problem_sidebar_normal.html +++ b/packages/ui-default/templates/partials/problem_sidebar_normal.html @@ -61,7 +61,8 @@ {% endif %} - {% if handler.user.hasPerm(perm.PERM_VIEW_DISCUSSION) or handler.user.hasPerm(perm.PERM_VIEW_PROBLEM_SOLUTION) %} + {% set _canViewSolution = handler.user.hasPerm(perm.PERM_VIEW_PROBLEM_SOLUTION) or (handler.user.hasPerm(perm.PERM_VIEW_PROBLEM_SOLUTION_ACCEPT) and tsdoc.status == STATUS.STATUS_ACCEPTED) %} + {% if handler.user.hasPerm(perm.PERM_VIEW_DISCUSSION) or _canViewSolution %}
{% endif %} {% if handler.user.hasPerm(perm.PERM_VIEW_DISCUSSION) %} @@ -69,7 +70,7 @@ {{ _('Discussions') }}{% if discussionCount !== undefined %} ({{ discussionCount }}){% endif %} {% endif %} - {% if handler.user.hasPerm(perm.PERM_VIEW_PROBLEM_SOLUTION) %} + {% if _canViewSolution %}