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
Boxiang Sun
gitlab-ce
Commits
2908f173
Commit
2908f173
authored
Sep 20, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve clarity of variable names in ProjectTeam#fetch_invited_members
parent
6f558121
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
app/models/project_team.rb
app/models/project_team.rb
+12
-14
No files found.
app/models/project_team.rb
View file @
2908f173
...
@@ -233,28 +233,26 @@ class ProjectTeam
...
@@ -233,28 +233,26 @@ class ProjectTeam
return
invited_members
unless
project_shared_with_group?
return
invited_members
unless
project_shared_with_group?
project
.
project_group_links
.
includes
(
group:
[
:group_members
]).
each
do
|
group_link
|
project
.
project_group_links
.
includes
(
group:
[
:group_members
]).
each
do
|
link
|
invited_group
=
group_link
.
group
invited_group_members
=
link
.
group
.
members
im
=
invited_group
.
members
if
level
if
level
int
_level
=
GroupMember
.
access_level_roles
[
level
.
to_s
.
singularize
.
titleize
]
numeric
_level
=
GroupMember
.
access_level_roles
[
level
.
to_s
.
singularize
.
titleize
]
#
Skip group members if we ask for masters
#
If we're asked for a level that's higher than the group's access,
#
but max group access is developers
#
there's nothing left to do
next
if
int_level
>
group_
link
.
group_access
next
if
numeric_level
>
link
.
group_access
# If we ask for developers and max
# Make sure we include everyone _above_ the requested level as well
# group access is developers we need to provide
if
numeric_level
==
link
.
group_access
# both group master, developers as devs
invited_group_members
=
invited_group_members
if
int_level
==
group_link
.
group_access
.
where
(
"access_level >= ?"
,
link
.
group_access
)
im
=
im
.
where
(
"access_level >= ?"
,
group_link
.
group_access
)
else
else
i
m
=
im
.
send
(
level
)
i
nvited_group_members
=
invited_group_members
.
send
(
level
)
end
end
end
end
invited_members
<<
i
m
invited_members
<<
i
nvited_group_members
end
end
invited_members
.
flatten
.
compact
invited_members
.
flatten
.
compact
...
...
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