Commit 8df23c28 authored by Jake Lear's avatar Jake Lear

Add gitlab_bot? method and allowlist gitlab bots for spam

parent 0709379d
......@@ -45,7 +45,7 @@ module Spam
attr_reader :user, :context
def allowlisted?(user)
user.respond_to?(:gitlab_employee) && user.gitlab_employee?
user.respond_to?(:gitlab_employee) && user.gitlab_employee? || user.respond_to?(:gitlab_bot) && user.gitlab_bot?
end
def perform_spam_service_check(api)
......
......@@ -358,6 +358,16 @@ module EE
end
end
def gitlab_bot?
strong_memoize(:gitlab_bot) do
if ::Gitlab.com?
bot? && ::Gitlab::Com.gitlab_com_group_member_id?(id)
else
false
end
end
end
def security_dashboard
InstanceSecurityDashboard.new(self)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment