Commit 105684e8 authored by http://jneen.net/'s avatar http://jneen.net/ Committed by Felipe Artur

add a support bot as a unique internal user

parent aab6fa7a
......@@ -17,6 +17,22 @@ module EE
validate :cannot_be_admin_and_auditor
end
module ClassMethods
def support_bot
email = Settings.service_desk.email || "support%s@#{Settings.gitlab.host}"
unique_internal(where(support_bot: true), 'support-bot', email) do |u|
u.bio = 'The GitLab support bot'
u.name = 'GitLab Support Bot'
end
end
# override
def internal_attributes
super + [:support_bot]
end
end
def cannot_be_admin_and_auditor
if admin? && auditor?
errors.add(:admin, "user cannot also be an Auditor.")
......@@ -36,5 +52,6 @@ module EE
def admin_or_auditor?
admin? || auditor?
end
end
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