summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-08-30 23:01:26 +0000
committerRobert Speicher <robert@gitlab.com>2016-08-30 23:01:26 +0000
commit88295e07426698ce2af32af73ac0c34e540a0ba0 (patch)
tree4f2a54fd0bd29130b92500b9d33c5c1f6b3c28c6 /lib/api
parent1e08429d2c9aa72918a0a3328d070f0768478463 (diff)
parentcf37d623e197dae5cc7efb021c1b1d85ca9674ee (diff)
downloadgitlab-ce-88295e07426698ce2af32af73ac0c34e540a0ba0.tar.gz
Merge branch 'project-specific-lfs' into 'master'
Added project specific enable/disable setting for LFS ## What does this MR do? Adds project specific enable/disable setting for LFS ## What are the relevant issue numbers? Needed for #18092 See merge request !5997
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb2
-rw-r--r--lib/api/projects.rb12
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index cbb324dd06d..4335e3055ef 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -78,7 +78,7 @@ module API
expose :path, :path_with_namespace
expose :issues_enabled, :merge_requests_enabled, :wiki_enabled, :builds_enabled, :snippets_enabled, :container_registry_enabled
expose :created_at, :last_activity_at
- expose :shared_runners_enabled
+ expose :shared_runners_enabled, :lfs_enabled
expose :creator_id
expose :namespace
expose :forked_from_project, using: Entities::BasicProjectDetails, if: lambda{ |project, options| project.forked? }
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 71efd4f33ca..f8979a1cc29 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -105,6 +105,7 @@ module API
# visibility_level (optional) - 0 by default
# import_url (optional)
# public_builds (optional)
+ # lfs_enabled (optional)
# Example Request
# POST /projects
post do
@@ -124,7 +125,8 @@ module API
:visibility_level,
:import_url,
:public_builds,
- :only_allow_merge_if_build_succeeds]
+ :only_allow_merge_if_build_succeeds,
+ :lfs_enabled]
attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(current_user, attrs).execute
if @project.saved?
@@ -156,6 +158,7 @@ module API
# visibility_level (optional)
# import_url (optional)
# public_builds (optional)
+ # lfs_enabled (optional)
# Example Request
# POST /projects/user/:user_id
post "user/:user_id" do
@@ -174,7 +177,8 @@ module API
:visibility_level,
:import_url,
:public_builds,
- :only_allow_merge_if_build_succeeds]
+ :only_allow_merge_if_build_succeeds,
+ :lfs_enabled]
attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(user, attrs).execute
if @project.saved?
@@ -220,6 +224,7 @@ module API
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - visibility level of a project
# public_builds (optional)
+ # lfs_enabled (optional)
# Example Request
# PUT /projects/:id
put ':id' do
@@ -237,7 +242,8 @@ module API
:public,
:visibility_level,
:public_builds,
- :only_allow_merge_if_build_succeeds]
+ :only_allow_merge_if_build_succeeds,
+ :lfs_enabled]
attrs = map_public_to_visibility_level(attrs)
authorize_admin_project
authorize! :rename_project, user_project if attrs[:name].present?