diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-04-25 00:12:14 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-04-25 05:27:39 +0300 |
commit | d7e2ac729317ace2ccf0203663637ba32f328d1a (patch) | |
tree | 55c00911d74ca7176cbb299db9a308e6bb23b088 /app | |
parent | 080aac050d852c332181a0e3fed7821d52d16c1a (diff) |
Fix OAuth, LDAP and SAML SSO when regular sign-ups are disabled
Diffstat (limited to 'app')
-rw-r--r-- | app/services/users/build_service.rb | 4 | ||||
-rw-r--r-- | app/services/users/create_service.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/services/users/build_service.rb b/app/services/users/build_service.rb index 9a0a5a12f91..d2a1c161026 100644 --- a/app/services/users/build_service.rb +++ b/app/services/users/build_service.rb @@ -6,8 +6,8 @@ module Users @params = params.dup end - def execute - raise Gitlab::Access::AccessDeniedError unless can_create_user? + def execute(skip_authorization: false) + raise Gitlab::Access::AccessDeniedError unless skip_authorization || can_create_user? user = User.new(build_user_params) diff --git a/app/services/users/create_service.rb b/app/services/users/create_service.rb index a2105d31f71..e22f7225ae2 100644 --- a/app/services/users/create_service.rb +++ b/app/services/users/create_service.rb @@ -6,8 +6,8 @@ module Users @params = params.dup end - def execute - user = Users::BuildService.new(current_user, params).execute + def execute(skip_authorization: false) + user = Users::BuildService.new(current_user, params).execute(skip_authorization: skip_authorization) @reset_token = user.generate_reset_token if user.recently_sent_password_reset? |