diff options
author | Toon Claes <toon@gitlab.com> | 2017-03-01 21:23:00 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-03-02 12:15:25 +0100 |
commit | a3fdd6acd27f5aa98f13e7a0083d0c3208003ccb (patch) | |
tree | e174834a5aaf50b0444f829e8a2cfd678e833455 /lib/api/projects.rb | |
parent | bc20fa9b02d5fea8f5781b6397af10f006983111 (diff) | |
download | gitlab-ce-a3fdd6acd27f5aa98f13e7a0083d0c3208003ccb.tar.gz |
Use string based `visibility` getter & setter
Add `visibility` & `visibility=` methods to the
`Gitlab::VisibilityLevel` module so the `visibility_level` can be
get/set with a string value.
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 743dcac41f9..f302496c12b 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -97,7 +97,7 @@ module API use :create_params end post do - attrs = map_visibility_level(declared_params(include_missing: false)) + attrs = declared_params(include_missing: false) project = ::Projects::CreateService.new(current_user, attrs).execute if project.saved? @@ -126,7 +126,7 @@ module API user = User.find_by(id: params.delete(:user_id)) not_found!('User') unless user - attrs = map_visibility_level(declared_params(include_missing: false)) + attrs = declared_params(include_missing: false) project = ::Projects::CreateService.new(user, attrs).execute if project.saved? @@ -211,9 +211,9 @@ module API end put ':id' do authorize_admin_project - attrs = map_visibility_level(declared_params(include_missing: false)) + attrs = declared_params(include_missing: false) authorize! :rename_project, user_project if attrs[:name].present? - authorize! :change_visibility_level, user_project if attrs[:visibility_level].present? + authorize! :change_visibility_level, user_project if attrs[:visibility].present? result = ::Projects::UpdateService.new(user_project, current_user, attrs).execute |