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
Tatuya Kamada
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
return
invited_members
unless
project_shared_with_group?
project
.
project_group_links
.
includes
(
group:
[
:group_members
]).
each
do
|
group_link
|
invited_group
=
group_link
.
group
im
=
invited_group
.
members
project
.
project_group_links
.
includes
(
group:
[
:group_members
]).
each
do
|
link
|
invited_group_members
=
link
.
group
.
members
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
#
but max group access is developers
next
if
int_level
>
group_
link
.
group_access
#
If we're asked for a level that's higher than the group's access,
#
there's nothing left to do
next
if
numeric_level
>
link
.
group_access
# If we ask for developers and max
# group access is developers we need to provide
# both group master, developers as devs
if
int_level
==
group_link
.
group_access
im
=
im
.
where
(
"access_level >= ?"
,
group_link
.
group_access
)
# Make sure we include everyone _above_ the requested level as well
if
numeric_level
==
link
.
group_access
invited_group_members
=
invited_group_members
.
where
(
"access_level >= ?"
,
link
.
group_access
)
else
i
m
=
im
.
send
(
level
)
i
nvited_group_members
=
invited_group_members
.
send
(
level
)
end
end
invited_members
<<
i
m
invited_members
<<
i
nvited_group_members
end
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