Skip to content

Commit

Permalink
don't throw error from discussion_service.mark_as_read if not authorized
Browse files Browse the repository at this point in the history
  • Loading branch information
robguthrie committed Jun 17, 2024
1 parent 6ee1b9d commit 8777233
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/discussion_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def self.mark_as_read_simple_params(discussion_id, ranges, actor_id)
end

def self.mark_as_read(discussion:, params:, actor:)
actor.ability.authorize! :mark_as_read, discussion
return unless actor.ability.can?(:mark_as_read, discussion)
RetryOnError.with_limit(2) do
sequence_ids = RangeSet.ranges_to_list(RangeSet.to_ranges(params[:ranges]))
NotificationService.viewed_events(actor_id: actor.id, discussion_id: discussion.id, sequence_ids: sequence_ids)
Expand Down

0 comments on commit 8777233

Please sign in to comment.