diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-27 16:20:57 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-07-01 17:44:46 +0200 |
commit | bd78f5733ca546bf940438b84aefa2fa3abacb36 (patch) | |
tree | 9d9ac648a594623489e628e025bde48f7ef2b2f9 /app/models/project_team.rb | |
parent | 557ca2b31ff503b36a4b65af2641fcd0f5682d5b (diff) | |
download | gitlab-ce-bd78f5733ca546bf940438b84aefa2fa3abacb36.tar.gz |
Exclude requesters from Project#members, Group#members and User#membersexplicit-requesters-scope
And create new Project#requesters, Group#requesters scopes.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/project_team.rb')
-rw-r--r-- | app/models/project_team.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/models/project_team.rb b/app/models/project_team.rb index 0865b979ce0..0b700930641 100644 --- a/app/models/project_team.rb +++ b/app/models/project_team.rb @@ -22,12 +22,12 @@ class ProjectTeam end def find_member(user_id) - member = project.members.non_request.find_by(user_id: user_id) + member = project.members.find_by(user_id: user_id) # If user is not in project members # we should check for group membership if group && !member - member = group.members.non_request.find_by(user_id: user_id) + member = group.members.find_by(user_id: user_id) end member @@ -137,10 +137,10 @@ class ProjectTeam def max_member_access(user_id) access = [] - access += project.members.non_request.where(user_id: user_id).has_access.pluck(:access_level) + access += project.members.where(user_id: user_id).has_access.pluck(:access_level) if group - access += group.members.non_request.where(user_id: user_id).has_access.pluck(:access_level) + access += group.members.where(user_id: user_id).has_access.pluck(:access_level) end if project.invited_groups.any? && project.allowed_to_share_with_group? @@ -168,14 +168,14 @@ class ProjectTeam end def fetch_members(level = nil) - project_members = project.members.non_request - group_members = group ? group.members.non_request : [] + project_members = project.members + group_members = group ? group.members : [] invited_members = [] if project.invited_groups.any? && project.allowed_to_share_with_group? project.project_group_links.each do |group_link| invited_group = group_link.group - im = invited_group.members.non_request + im = invited_group.members if level int_level = GroupMember.access_level_roles[level.to_s.singularize.titleize] |