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
ded67d3b
Commit
ded67d3b
authored
Jul 06, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implements filter_params
parent
be3409ab
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
lib/api/entities.rb
lib/api/entities.rb
+2
-0
lib/api/helpers.rb
lib/api/helpers.rb
+17
-0
No files found.
lib/api/entities.rb
View file @
ded67d3b
...
...
@@ -353,7 +353,9 @@ module API
class
ProjectWithAccess
<
Project
expose
:permissions
do
expose
:project_access
,
using:
Entities
::
ProjectAccess
do
|
project
,
options
|
project
=
Project
.
find_by
(
project
[
:id
])
project
.
project_members
.
find_by
(
user_id:
options
[
:user
].
id
)
]
end
expose
:group_access
,
using:
Entities
::
GroupAccess
do
|
project
,
options
|
...
...
lib/api/helpers.rb
View file @
ded67d3b
...
...
@@ -287,6 +287,23 @@ module API
# Projects helpers
def
filter_params
(
projects
)
project_entries
=
[]
# Removes the redundant information of the object
projects
.
each
do
|
project
|
entry
=
{
id:
project
.
id
,
http_url_to_repo:
project
.
http_url_to_repo
,
name_with_namespace:
project
.
name_with_namespace
}
project_entries
<<
entry
end
project_entries
end
def
filter_projects
(
projects
)
# If the archived parameter is passed, limit results accordingly
if
params
[
:archived
].
present?
...
...
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