Skip to content

Commit

Permalink
enable admin to reply close comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Jun 19, 2024
1 parent d89aeaf commit 2335e68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions decidim-comments/app/cells/decidim/comments/comment_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Comments
# A cell to display a single comment.
class CommentCell < Decidim::ViewModel
include Decidim::ResourceHelper
include Decidim::UserRoleChecker
include Cell::ViewModel::Partial

delegate :current_user, :user_signed_in?, to: :controller
Expand Down Expand Up @@ -95,6 +96,8 @@ def context_menu_id
end

def can_reply?
return true if user_has_any_role?(current_user)

user_signed_in? && accepts_new_comments? &&
root_commentable.user_allowed_to_comment?(current_user)
end
Expand Down

0 comments on commit 2335e68

Please sign in to comment.