Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
105684e8
Commit
105684e8
authored
Mar 23, 2017
by
http://jneen.net/
Committed by
Felipe Artur
Apr 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a support bot as a unique internal user
parent
aab6fa7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
app/models/ee/user.rb
app/models/ee/user.rb
+17
-0
No files found.
app/models/ee/user.rb
View file @
105684e8
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment