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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
87bf08c9
Commit
87bf08c9
authored
Jun 19, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix specs
parent
3bab585b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/services/emails/create_service.rb
app/services/emails/create_service.rb
+1
-1
app/services/emails/destroy_service.rb
app/services/emails/destroy_service.rb
+1
-1
lib/api/users.rb
lib/api/users.rb
+2
-2
No files found.
app/services/emails/create_service.rb
View file @
87bf08c9
module
Emails
class
CreateService
<
BaseService
class
CreateService
<
::
Emails
::
BaseService
def
execute
(
skip_authorization:
false
)
raise
Gitlab
::
Access
::
AccessDeniedError
unless
skip_authorization
||
can_manage_emails?
...
...
app/services/emails/destroy_service.rb
View file @
87bf08c9
module
Emails
class
DestroyService
<
BaseService
class
DestroyService
<
::
Emails
::
BaseService
def
execute
(
skip_authorization:
false
)
raise
Gitlab
::
Access
::
AccessDeniedError
unless
skip_authorization
||
can_manage_emails?
...
...
lib/api/users.rb
View file @
87bf08c9
...
...
@@ -276,7 +276,7 @@ module API
email
=
user
.
emails
.
find_by
(
id:
params
[
:email_id
])
not_found!
(
'Email'
)
unless
email
Emails
::
DestroyService
.
new
(
current_user
,
self
,
email:
email
.
email
).
execute
Emails
::
DestroyService
.
new
(
current_user
,
user
,
email:
email
.
email
).
execute
::
Users
::
UpdateService
.
new
(
current_user
,
user
).
execute
do
|
user
|
user
.
update_secondary_emails!
...
...
@@ -510,7 +510,7 @@ module API
email
=
current_user
.
emails
.
find_by
(
id:
params
[
:email_id
])
not_found!
(
'Email'
)
unless
email
Emails
::
DestroyService
.
new
(
current_user
,
self
,
email:
email
.
email
).
execute
Emails
::
DestroyService
.
new
(
current_user
,
current_user
,
email:
email
.
email
).
execute
::
Users
::
UpdateService
.
new
(
current_user
,
current_user
).
execute
do
|
user
|
user
.
update_secondary_emails!
...
...
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