- if current_user&.moderator?
- @note = Note.find(params[:id])
- @note_comments = @note.comments.unscope(:where => :visible)
- else
- @note = Note.visible.find(params[:id])
- @note_comments = @note.comments
- end
- rescue ActiveRecord::RecordNotFound
- render :action => "not_found", :status => :not_found
+ private
+
+ def require_moderator_for_unredacted_history
+ deny_access(nil) if params[:show_redactions] && !current_user&.moderator?