summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-02-04 11:14:12 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-04 11:14:12 +0100
commit6a5a175d9fd1d72cdaab033eefc4191561e619cc (patch)
treec3bc32ebdd3fe8f429bbbecf7260188636a7385f /lib
parent5f7be11aa6d5d9edc31baa09b50ac21ee80533aa (diff)
downloadgitlab-ce-6a5a175d9fd1d72cdaab033eefc4191561e619cc.tar.gz
Expose allow_guest_to_access_builds in GitLab API
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb1
-rw-r--r--lib/api/projects.rb12
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 82a75734de0..3a68b2c7801 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -72,6 +72,7 @@ module API
expose :star_count, :forks_count
expose :open_issues_count, if: lambda { |project, options| project.issues_enabled? && project.default_issues_tracker? }
expose :runners_token, if: lambda { |_project, options| options[:user_can_admin_project] }
+ expose :allow_guest_to_access_builds
end
class ProjectMember < UserBasic
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 1f991e600e3..f68598e991b 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -99,6 +99,7 @@ module API
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - 0 by default
# import_url (optional)
+ # allow_guest_to_access_builds (optional)
# Example Request
# POST /projects
post do
@@ -115,7 +116,8 @@ module API
:namespace_id,
:public,
:visibility_level,
- :import_url]
+ :import_url,
+ :allow_guest_to_access_builds]
attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(current_user, attrs).execute
if @project.saved?
@@ -145,6 +147,7 @@ module API
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional)
# import_url (optional)
+ # allow_guest_to_access_builds (optional)
# Example Request
# POST /projects/user/:user_id
post "user/:user_id" do
@@ -161,7 +164,8 @@ module API
:shared_runners_enabled,
:public,
:visibility_level,
- :import_url]
+ :import_url,
+ :allow_guest_to_access_builds]
attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(user, attrs).execute
if @project.saved?
@@ -205,6 +209,7 @@ module API
# shared_runners_enabled (optional)
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - visibility level of a project
+ # allow_guest_to_access_builds (optional)
# Example Request
# PUT /projects/:id
put ':id' do
@@ -219,7 +224,8 @@ module API
:snippets_enabled,
:shared_runners_enabled,
:public,
- :visibility_level]
+ :visibility_level,
+ :allow_guest_to_access_builds]
attrs = map_public_to_visibility_level(attrs)
authorize_admin_project
authorize! :rename_project, user_project if attrs[:name].present?