lib/decidim/proposals/commentable_proposal.rb in decidim-proposals-0.24.3 vs lib/decidim/proposals/commentable_proposal.rb in decidim-proposals-0.25.0.rc1

- old
+ new

@@ -3,23 +3,13 @@ module Decidim module Proposals # The data store for a Proposal in the Decidim::Proposals component. module CommentableProposal extend ActiveSupport::Concern - include Decidim::Comments::Commentable + include Decidim::Comments::CommentableWithComponent included do - # Public: Overrides the `commentable?` Commentable concern method. - def commentable? - component.settings.comments_enabled? - end - - # Public: Overrides the `accepts_new_comments?` Commentable concern method. - def accepts_new_comments? - commentable? && !component.current_settings.comments_blocked - end - # Public: Overrides the `comments_have_alignment?` Commentable concern method. def comments_have_alignment? true end @@ -33,11 +23,13 @@ return (followers | component.participatory_space.admins).uniq if official? followers end - def user_allowed_to_comment?(user) - can_participate_in_space?(user) + def user_allowed_to_vote_comment?(user) + return unless can_participate_in_space?(user) + + ActionAuthorizer.new(user, "vote_comment", component, self).authorize.ok? end end end end end