diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-12-27 18:00:49 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-12-27 18:00:49 +0300 |
commit | 20afb4c69ee91a91094eed2bffd566c5bca1ce0d (patch) | |
tree | 632bbb3e3e8978a8d7bb2e26dd91edf9b83ecd4d /app/controllers | |
parent | cdb29c2fb00a873e8f8f646b06c7b000cc13e610 (diff) | |
parent | c1d11bf57c3091aa4695e302e21c39b9ec723f54 (diff) |
Merge branch 'feature/1376-allow-write-access-deploy-keys' into 'master'
Allow to add deploy keys with write-access
Closes #1376
See merge request !7383
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/deploy_keys_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/projects/deploy_keys_controller.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/admin/deploy_keys_controller.rb b/app/controllers/admin/deploy_keys_controller.rb index 285e8495342..4f6a7e9e2cb 100644 --- a/app/controllers/admin/deploy_keys_controller.rb +++ b/app/controllers/admin/deploy_keys_controller.rb @@ -10,7 +10,7 @@ class Admin::DeployKeysController < Admin::ApplicationController end def create - @deploy_key = deploy_keys.new(deploy_key_params) + @deploy_key = deploy_keys.new(deploy_key_params.merge(user: current_user)) if @deploy_key.save redirect_to admin_deploy_keys_path @@ -39,6 +39,6 @@ class Admin::DeployKeysController < Admin::ApplicationController end def deploy_key_params - params.require(:deploy_key).permit(:key, :title) + params.require(:deploy_key).permit(:key, :title, :can_push) end end diff --git a/app/controllers/projects/deploy_keys_controller.rb b/app/controllers/projects/deploy_keys_controller.rb index 529e0aa2d33..b094491e006 100644 --- a/app/controllers/projects/deploy_keys_controller.rb +++ b/app/controllers/projects/deploy_keys_controller.rb @@ -16,7 +16,7 @@ class Projects::DeployKeysController < Projects::ApplicationController end def create - @key = DeployKey.new(deploy_key_params) + @key = DeployKey.new(deploy_key_params.merge(user: current_user)) set_index_vars if @key.valid? && @project.deploy_keys << @key @@ -53,6 +53,6 @@ class Projects::DeployKeysController < Projects::ApplicationController end def deploy_key_params - params.require(:deploy_key).permit(:key, :title) + params.require(:deploy_key).permit(:key, :title, :can_push) end end |