diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /lib/api/users.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'lib/api/users.rb')
-rw-r--r-- | lib/api/users.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 565a3544da2..2608fb87e22 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -241,7 +241,7 @@ module API authenticated_as_admin! params = declared_params(include_missing: false) - user = ::Users::CreateService.new(current_user, params).execute(skip_authorization: true) + user = ::Users::AuthorizedCreateService.new(current_user, params).execute if user.persisted? present user, with: Entities::UserWithAdmin, current_user: current_user @@ -1025,7 +1025,9 @@ module API detail 'This feature was introduced in GitLab 13.10.' end params do - requires :view_diffs_file_by_file, type: Boolean, desc: 'Flag indicating the user sees only one file diff per page' + optional :view_diffs_file_by_file, type: Boolean, desc: 'Flag indicating the user sees only one file diff per page' + optional :show_whitespace_in_diffs, type: Boolean, desc: 'Flag indicating the user sees whitespace changes in diffs' + at_least_one_of :view_diffs_file_by_file, :show_whitespace_in_diffs end put "preferences", feature_category: :users do authenticate! @@ -1043,6 +1045,14 @@ module API end end + desc "Get the current user's preferences" do + success Entities::UserPreferences + detail 'This feature was introduced in GitLab 14.0.' + end + get "preferences", feature_category: :users do + present current_user.user_preference, with: Entities::UserPreferences + end + desc 'Get a single email address owned by the currently authenticated user' do success Entities::Email end |