Create api changeset comment visibility resource

This commit is contained in:
Anton Khorev 2025-02-23 04:59:26 +03:00
parent 457cc99349
commit 84a0c76ab2
13 changed files with 356 additions and 299 deletions

View file

@ -63,7 +63,7 @@ module Api
@changeset = Changeset.find(params[:id])
if params[:include_discussion].presence
@comments = @changeset.comments
@comments = @comments.unscope(:where => :visible) if params[:show_hidden_comments].presence && can?(:restore, ChangesetComment)
@comments = @comments.unscope(:where => :visible) if params[:show_hidden_comments].presence && can?(:create, :changeset_comment_visibility)
@comments = @comments.includes(:author)
end