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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
0b7c4fe0
Commit
0b7c4fe0
authored
May 15, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't include users without project access in participants.
parent
fb86ec51
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
CHANGELOG
CHANGELOG
+1
-1
app/models/concerns/participable.rb
app/models/concerns/participable.rb
+14
-6
No files found.
CHANGELOG
View file @
0b7c4fe0
...
...
@@ -44,7 +44,7 @@ v 7.11.0 (unreleased)
- Fix bug where avatar filenames were not actually deleted from the database during removal (Stan Hu)
- Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu)
- Protect OmniAuth request phase against CSRF.
-
-
Don't send notifications to mentioned users that don't have access to the project in question.
-
- Move snippets UI to fluid layout
- Improve UI for sidebar. Increase separation between navigation and content
...
...
app/models/concerns/participable.rb
View file @
0b7c4fe0
...
...
@@ -35,8 +35,8 @@ module Participable
end
end
def
participants
(
current_user
=
self
.
author
)
self
.
class
.
participant_attrs
.
flat_map
do
|
attr
|
def
participants
(
current_user
=
self
.
author
,
project
=
self
.
project
)
participants
=
self
.
class
.
participant_attrs
.
flat_map
do
|
attr
|
meth
=
method
(
attr
)
value
=
...
...
@@ -46,20 +46,28 @@ module Participable
meth
.
call
end
participants_for
(
value
,
current_user
)
participants_for
(
value
,
current_user
,
project
)
end
.
compact
.
uniq
if
project
participants
.
select!
do
|
user
|
user
.
can?
(
:read_project
,
project
)
end
end
participants
end
private
def
participants_for
(
value
,
current_user
=
nil
)
def
participants_for
(
value
,
current_user
=
nil
,
project
=
nil
)
case
value
when
User
[
value
]
when
Enumerable
,
ActiveRecord
::
Relation
value
.
flat_map
{
|
v
|
participants_for
(
v
,
current_user
)
}
value
.
flat_map
{
|
v
|
participants_for
(
v
,
current_user
,
project
)
}
when
Participable
value
.
participants
(
current_user
)
value
.
participants
(
current_user
,
project
)
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