diff options
author | Imre Farkas <ifarkas@gitlab.com> | 2019-05-28 10:14:43 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2019-05-28 10:14:43 +0000 |
commit | ba4977ab96e1a58f8b77eb8190e19849c27caf6e (patch) | |
tree | d8230e4d4f5cb5ae474f98838631bace624dba6f /lib/api/variables.rb | |
parent | c86244383f926493c0b76957fa5683b3a4532a55 (diff) | |
download | gitlab-ce-ba4977ab96e1a58f8b77eb8190e19849c27caf6e.tar.gz |
CE port of Move EE specific lines in API::Variables
Diffstat (limited to 'lib/api/variables.rb')
-rw-r--r-- | lib/api/variables.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/api/variables.rb b/lib/api/variables.rb index 6c61392ed63..af1d7936556 100644 --- a/lib/api/variables.rb +++ b/lib/api/variables.rb @@ -7,6 +7,8 @@ module API before { authenticate! } before { authorize! :admin_build, user_project } + helpers Helpers::VariablesHelpers + helpers do def filter_variable_parameters(params) # This method exists so that EE can more easily filter out certain @@ -58,9 +60,7 @@ module API optional :masked, type: Boolean, desc: 'Whether the variable is masked' optional :variable_type, type: String, values: Ci::Variable.variable_types.keys, desc: 'The type of variable, must be one of env_var or file. Defaults to env_var' - if Gitlab.ee? - optional :environment_scope, type: String, desc: 'The environment_scope of the variable' - end + use :optional_params_ee end post ':id/variables' do variable_params = declared_params(include_missing: false) @@ -85,9 +85,7 @@ module API optional :masked, type: Boolean, desc: 'Whether the variable is masked' optional :variable_type, type: String, values: Ci::Variable.variable_types.keys, desc: 'The type of variable, must be one of env_var or file' - if Gitlab.ee? - optional :environment_scope, type: String, desc: 'The environment_scope of the variable' - end + use :optional_params_ee end # rubocop: disable CodeReuse/ActiveRecord put ':id/variables/:key' do |