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
7f6df32f
Commit
7f6df32f
authored
Apr 04, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small code fixes
parent
7660e2fc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
17 deletions
+13
-17
app/models/ee/issue.rb
app/models/ee/issue.rb
+2
-6
app/models/ee/user.rb
app/models/ee/user.rb
+2
-3
app/policies/ee/project_policy.rb
app/policies/ee/project_policy.rb
+1
-1
app/services/ee/notification_service.rb
app/services/ee/notification_service.rb
+3
-2
lib/gitlab/email/handler/ee/service_desk_handler.rb
lib/gitlab/email/handler/ee/service_desk_handler.rb
+3
-3
lib/gitlab/ldap/adapter.rb
lib/gitlab/ldap/adapter.rb
+1
-1
lib/gitlab/ldap/person.rb
lib/gitlab/ldap/person.rb
+1
-1
No files found.
app/models/ee/issue.rb
View file @
7f6df32f
...
...
@@ -2,9 +2,7 @@ module EE
module
Issue
# override
def
check_for_spam?
return
true
if
author
.
support_bot?
super
author
.
support_bot?
||
super
end
# override
...
...
@@ -27,9 +25,7 @@ module EE
# is not as bad as it seems, though, since it isn't
# permitted to :receive_notifications, and doesn't
# actually show up in the participants list.
return
true
if
user
==
::
User
.
support_bot
super
::
User
.
support_bot
||
super
end
end
end
app/models/ee/user.rb
View file @
7f6df32f
...
...
@@ -21,8 +21,8 @@ module EE
def
support_bot
email_pattern
=
"support%s@
#{
Settings
.
gitlab
.
host
}
"
unique_internal
(
where
(
support_bot:
true
),
'support-bot'
,
email
)
do
|
u
|
u
.
bio
=
'The GitLab support bot'
unique_internal
(
where
(
support_bot:
true
),
'support-bot'
,
email
_pattern
)
do
|
u
|
u
.
bio
=
'The GitLab support bot
used for Service Desk
'
u
.
name
=
'GitLab Support Bot'
end
end
...
...
@@ -52,6 +52,5 @@ module EE
def
admin_or_auditor?
admin?
||
auditor?
end
end
end
app/policies/ee/project_policy.rb
View file @
7f6df32f
...
...
@@ -12,7 +12,7 @@ module EE
cannot!
:push_code_to_protected_branches
end
if
@user
&&
@user
.
support_bot?
&&
!
@subject
.
service_desk_enabled?
if
@user
&
.
support_bot?
&&
!
@subject
.
service_desk_enabled?
cannot!
:create_note
cannot!
:read_project
end
...
...
app/services/ee/notification_service.rb
View file @
7f6df32f
...
...
@@ -14,11 +14,12 @@ module EE
issue
=
note
.
noteable
reply_to
=
issue
.
service_desk_reply_to
support_bot
=
::
User
.
support_bot
return
unless
issue
.
service_desk_reply_to
.
present?
return
unless
issue
.
project
.
service_desk_enabled?
return
if
note
.
author
==
User
.
support_bot
return
unless
issue
.
subscribed?
(
::
User
.
support_bot
,
issue
.
project
)
return
if
note
.
author
==
support_bot
return
unless
issue
.
subscribed?
(
support_bot
,
issue
.
project
)
Notify
.
service_desk_new_note_email
(
issue
.
id
,
note
.
id
)
end
...
...
lib/gitlab/email/handler/ee/service_desk_handler.rb
View file @
7f6df32f
...
...
@@ -30,10 +30,10 @@ module Gitlab
def
project
return
@project
if
instance_variable_defined?
(
:@project
)
@project
=
Project
.
where
(
@project
=
Project
.
find_by
(
service_desk_enabled:
true
,
service_desk_mail_key:
service_desk_key
)
.
first
)
end
def
create_issue!
...
...
@@ -43,7 +43,7 @@ module Gitlab
@issue
=
Issues
::
CreateService
.
new
(
project
,
User
.
support_bot
,
title:
issue_title
title:
issue_title
,
description:
message
,
confidential:
true
,
service_desk_reply_to:
from_address
,
...
...
lib/gitlab/ldap/adapter.rb
View file @
7f6df32f
...
...
@@ -5,7 +5,7 @@
module
Gitlab
module
LDAP
class
Adapter
prepend
EE
::
Gitlab
::
LDAP
::
Adapter
prepend
::
EE
::
Gitlab
::
LDAP
::
Adapter
attr_reader
:provider
,
:ldap
...
...
lib/gitlab/ldap/person.rb
View file @
7f6df32f
module
Gitlab
module
LDAP
class
Person
include
EE
::
Gitlab
::
LDAP
::
Person
include
::
EE
::
Gitlab
::
LDAP
::
Person
# Active Directory-specific LDAP filter that checks if bit 2 of the
# userAccountControl attribute is set.
...
...
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