summaryrefslogtreecommitdiff
path: root/lib/api/lint.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/lint.rb')
-rw-r--r--lib/api/lint.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/lint.rb b/lib/api/lint.rb
index 945cdf3edb2..3580a7b5e24 100644
--- a/lib/api/lint.rb
+++ b/lib/api/lint.rb
@@ -11,7 +11,11 @@ module API
optional :include_merged_yaml, type: Boolean, desc: 'Whether or not to include merged CI config yaml in the response'
end
post '/lint' do
- unauthorized! if (Gitlab::CurrentSettings.signup_disabled? || Gitlab::CurrentSettings.signup_limited?) && current_user.nil?
+ if Feature.enabled?(:security_ci_lint_authorization)
+ unauthorized! if (Gitlab::CurrentSettings.signup_disabled? || Gitlab::CurrentSettings.signup_limited?) && current_user.nil?
+ else
+ unauthorized! if Gitlab::CurrentSettings.signup_disabled? && current_user.nil?
+ end
result = Gitlab::Ci::YamlProcessor.new(params[:content], user: current_user).execute