diff options
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 5819b366f7f..5aa16b117fd 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1299,7 +1299,9 @@ module API class Release < Grape::Entity include ::API::Helpers::Presentable - expose :name + expose :name do |release, _| + can_download_code? ? release.name : "Release-#{release.id}" + end expose :tag, as: :tag_name, if: ->(_, _) { can_download_code? } expose :description expose :description_html do |entity| |