Commit 6f558121 authored by Robert Speicher's avatar Robert Speicher

Fix a logic error in ProjectTeam#fetch_invited_members

We were calling `.where` and `.send` on the relation, but never doing
anything with the return value, resulting in proper access-level
filtering never being of any consequence.
parent b7b41d1f
...@@ -248,9 +248,9 @@ class ProjectTeam ...@@ -248,9 +248,9 @@ class ProjectTeam
# group access is developers we need to provide # group access is developers we need to provide
# both group master, developers as devs # both group master, developers as devs
if int_level == group_link.group_access if int_level == group_link.group_access
im.where("access_level >= ?)", group_link.group_access) im = im.where("access_level >= ?", group_link.group_access)
else else
im.send(level) im = im.send(level)
end end
end end
......
...@@ -111,6 +111,7 @@ describe ProjectTeam, models: true do ...@@ -111,6 +111,7 @@ describe ProjectTeam, models: true do
group_access: Gitlab::Access::REPORTER group_access: Gitlab::Access::REPORTER
) )
expect(project.team.guests).to be_empty
expect(project.team.reporters).to contain_exactly(group_member.user) expect(project.team.reporters).to contain_exactly(group_member.user)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment