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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
29d84b61
Commit
29d84b61
authored
Jul 06, 2018
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes linter errors
parent
0d6374ac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
lib/api/helpers/members_helpers.rb
lib/api/helpers/members_helpers.rb
+10
-10
No files found.
lib/api/helpers/members_helpers.rb
View file @
29d84b61
...
...
@@ -12,25 +12,25 @@ module API
end
def
find_all_members
(
source_type
,
source
)
members
=
(
source_type
==
'project'
)
?
find_all_members_for_project
(
source
)
:
find_all_members_for_group
(
source
)
members
.
non_invite
.
non_request
members
=
source_type
==
'project'
?
find_all_members_for_project
(
source
)
:
find_all_members_for_group
(
source
)
members
.
non_invite
.
non_request
end
def
find_all_members_for_project
(
project
)
shared_group_ids
=
project
.
project_group_links
.
pluck
(
:group_id
)
source_ids
=
[
project
.
id
,
project
.
group
&
.
id
].
concat
(
shared_group_ids
).
compact
Member
.
includes
(
:user
)
.
joins
(
user: :project_authorizations
).
where
(
project_authorizations:
{
project_id:
project
.
id
}).
where
(
source_id:
source_ids
)
Member
.
includes
(
:user
)
.
joins
(
user: :project_authorizations
)
.
where
(
project_authorizations:
{
project_id:
project
.
id
})
.
where
(
source_id:
source_ids
)
end
def
find_all_members_for_group
(
group
)
source_ids
=
group
.
self_and_ancestors
.
pluck
(
:id
)
Member
.
includes
(
:user
)
.
where
(
source_id:
source_ids
).
where
(
source_type:
'Namespace'
)
Member
.
includes
(
:user
)
.
where
(
source_id:
source_ids
)
.
where
(
source_type:
'Namespace'
)
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