summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
authorJ.D. Bean <jonathandbean@gmail.com>2018-10-26 15:12:14 +0000
committerNick Thomas <nick@gitlab.com>2018-10-26 15:12:14 +0000
commitff89680330584d9f589486605eae721a7566aef7 (patch)
treea07f857b91cf95a214c6597a01316ee5ca0e971e /lib/api/projects.rb
parent83e898a57cd1b396968a0befe277b6d9d1507a11 (diff)
downloadgitlab-ce-ff89680330584d9f589486605eae721a7566aef7.tar.gz
Feature/add license to project API
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index ae2d327e45b..0a914f9012e 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -114,7 +114,8 @@ module API
options = options.reverse_merge(
with: current_user ? Entities::ProjectWithAccess : Entities::BasicProjectDetails,
statistics: params[:statistics],
- current_user: current_user
+ current_user: current_user,
+ license: false
)
options[:with] = Entities::BasicProjectDetails if params[:simple]
@@ -230,13 +231,17 @@ module API
params do
use :statistics_params
use :with_custom_attributes
+
+ optional :license, type: Boolean, default: false,
+ desc: 'Include project license data'
end
get ":id" do
options = {
with: current_user ? Entities::ProjectWithAccess : Entities::BasicProjectDetails,
current_user: current_user,
user_can_admin_project: can?(current_user, :admin_project, user_project),
- statistics: params[:statistics]
+ statistics: params[:statistics],
+ license: params[:license]
}
project, options = with_custom_attributes(user_project, options)