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
26b28103
Commit
26b28103
authored
Mar 30, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mentions on confidential issues doesn't create todos for non-members
parent
79467437
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
25 deletions
+79
-25
CHANGELOG
CHANGELOG
+3
-0
app/services/todo_service.rb
app/services/todo_service.rb
+20
-4
spec/services/todo_service_spec.rb
spec/services/todo_service_spec.rb
+56
-21
No files found.
CHANGELOG
View file @
26b28103
...
...
@@ -14,6 +14,9 @@ v 8.7.0 (unreleased)
- Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
- Gracefully handle notes on deleted commits in merge requests (Stan Hu)
v 8.6.3 (unreleased)
- Mentions on confidential issues doesn't create todos for non-members
v 8.6.2
- Fix dropdown alignment. !3298
- Fix issuable sidebar overlaps on tablet. !3299
...
...
app/services/todo_service.rb
View file @
26b28103
...
...
@@ -170,14 +170,30 @@ class TodoService
end
def
filter_mentioned_users
(
project
,
target
,
author
)
mentioned_users
=
target
.
mentioned_users
.
select
do
|
user
|
user
.
can?
(
:read_project
,
project
)
end
mentioned_users
=
target
.
mentioned_users
mentioned_users
=
reject_users_without_access
(
mentioned_users
,
project
,
target
)
mentioned_users
.
delete
(
author
)
mentioned_users
.
uniq
end
def
reject_users_without_access
(
users
,
project
,
target
)
if
target
.
is_a?
(
Note
)
&&
target
.
for_issue?
target
=
target
.
noteable
end
if
target
.
is_a?
(
Issue
)
select_users
(
users
,
:read_issue
,
target
)
else
select_users
(
users
,
:read_project
,
project
)
end
end
def
select_users
(
users
,
ability
,
subject
)
users
.
select
do
|
user
|
user
.
can?
(
ability
.
to_sym
,
subject
)
end
end
def
pending_todos
(
user
,
criteria
=
{})
valid_keys
=
[
:project_id
,
:target_id
,
:target_type
,
:commit_id
]
user
.
todos
.
pending
.
where
(
criteria
.
slice
(
*
valid_keys
))
...
...
spec/services/todo_service_spec.rb
View file @
26b28103
This diff is collapsed.
Click to expand it.
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