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
Boxiang Sun
gitlab-ce
Commits
ae9218a7
Commit
ae9218a7
authored
Mar 07, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove user_can_download_artifacts
It was actually not used anywhere.
parent
901fbda6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
32 deletions
+16
-32
lib/api/jobs.rb
lib/api/jobs.rb
+8
-16
lib/api/v3/builds.rb
lib/api/v3/builds.rb
+8
-16
No files found.
lib/api/jobs.rb
View file @
ae9218a7
...
@@ -38,8 +38,7 @@ module API
...
@@ -38,8 +38,7 @@ module API
builds
=
user_project
.
builds
.
order
(
'id DESC'
)
builds
=
user_project
.
builds
.
order
(
'id DESC'
)
builds
=
filter_builds
(
builds
,
params
[
:scope
])
builds
=
filter_builds
(
builds
,
params
[
:scope
])
present
paginate
(
builds
),
with:
Entities
::
Job
,
present
paginate
(
builds
),
with:
Entities
::
Job
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Get pipeline jobs'
do
desc
'Get pipeline jobs'
do
...
@@ -55,8 +54,7 @@ module API
...
@@ -55,8 +54,7 @@ module API
builds
=
pipeline
.
builds
builds
=
pipeline
.
builds
builds
=
filter_builds
(
builds
,
params
[
:scope
])
builds
=
filter_builds
(
builds
,
params
[
:scope
])
present
paginate
(
builds
),
with:
Entities
::
Job
,
present
paginate
(
builds
),
with:
Entities
::
Job
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Get a specific job of a project'
do
desc
'Get a specific job of a project'
do
...
@@ -70,8 +68,7 @@ module API
...
@@ -70,8 +68,7 @@ module API
build
=
get_build!
(
params
[
:job_id
])
build
=
get_build!
(
params
[
:job_id
])
present
build
,
with:
Entities
::
Job
,
present
build
,
with:
Entities
::
Job
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Download the artifacts file from a job'
do
desc
'Download the artifacts file from a job'
do
...
@@ -138,8 +135,7 @@ module API
...
@@ -138,8 +135,7 @@ module API
build
.
cancel
build
.
cancel
present
build
,
with:
Entities
::
Job
,
present
build
,
with:
Entities
::
Job
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Retry a specific build of a project'
do
desc
'Retry a specific build of a project'
do
...
@@ -156,8 +152,7 @@ module API
...
@@ -156,8 +152,7 @@ module API
build
=
Ci
::
Build
.
retry
(
build
,
current_user
)
build
=
Ci
::
Build
.
retry
(
build
,
current_user
)
present
build
,
with:
Entities
::
Job
,
present
build
,
with:
Entities
::
Job
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Erase job (remove artifacts and the trace)'
do
desc
'Erase job (remove artifacts and the trace)'
do
...
@@ -173,8 +168,7 @@ module API
...
@@ -173,8 +168,7 @@ module API
return
forbidden!
(
'Job is not erasable!'
)
unless
build
.
erasable?
return
forbidden!
(
'Job is not erasable!'
)
unless
build
.
erasable?
build
.
erase
(
erased_by:
current_user
)
build
.
erase
(
erased_by:
current_user
)
present
build
,
with:
Entities
::
Job
,
present
build
,
with:
Entities
::
Job
user_can_download_artifacts:
can?
(
current_user
,
:download_build_artifacts
,
user_project
)
end
end
desc
'Keep the artifacts to prevent them from being deleted'
do
desc
'Keep the artifacts to prevent them from being deleted'
do
...
@@ -192,8 +186,7 @@ module API
...
@@ -192,8 +186,7 @@ module API
build
.
keep_artifacts!
build
.
keep_artifacts!
status
200
status
200
present
build
,
with:
Entities
::
Job
,
present
build
,
with:
Entities
::
Job
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Trigger a manual job'
do
desc
'Trigger a manual job'
do
...
@@ -213,8 +206,7 @@ module API
...
@@ -213,8 +206,7 @@ module API
build
.
play
(
current_user
)
build
.
play
(
current_user
)
status
200
status
200
present
build
,
with:
Entities
::
Job
,
present
build
,
with:
Entities
::
Job
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
end
end
...
...
lib/api/v3/builds.rb
View file @
ae9218a7
...
@@ -36,8 +36,7 @@ module API
...
@@ -36,8 +36,7 @@ module API
builds
=
user_project
.
builds
.
order
(
'id DESC'
)
builds
=
user_project
.
builds
.
order
(
'id DESC'
)
builds
=
filter_builds
(
builds
,
params
[
:scope
])
builds
=
filter_builds
(
builds
,
params
[
:scope
])
present
paginate
(
builds
),
with:
::
API
::
V3
::
Entities
::
Build
,
present
paginate
(
builds
),
with:
::
API
::
V3
::
Entities
::
Build
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Get builds for a specific commit of a project'
do
desc
'Get builds for a specific commit of a project'
do
...
@@ -57,8 +56,7 @@ module API
...
@@ -57,8 +56,7 @@ module API
builds
=
user_project
.
builds
.
where
(
pipeline:
pipelines
).
order
(
'id DESC'
)
builds
=
user_project
.
builds
.
where
(
pipeline:
pipelines
).
order
(
'id DESC'
)
builds
=
filter_builds
(
builds
,
params
[
:scope
])
builds
=
filter_builds
(
builds
,
params
[
:scope
])
present
paginate
(
builds
),
with:
::
API
::
V3
::
Entities
::
Build
,
present
paginate
(
builds
),
with:
::
API
::
V3
::
Entities
::
Build
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Get a specific build of a project'
do
desc
'Get a specific build of a project'
do
...
@@ -72,8 +70,7 @@ module API
...
@@ -72,8 +70,7 @@ module API
build
=
get_build!
(
params
[
:build_id
])
build
=
get_build!
(
params
[
:build_id
])
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
,
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Download the artifacts file from build'
do
desc
'Download the artifacts file from build'
do
...
@@ -140,8 +137,7 @@ module API
...
@@ -140,8 +137,7 @@ module API
build
.
cancel
build
.
cancel
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
,
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Retry a specific build of a project'
do
desc
'Retry a specific build of a project'
do
...
@@ -158,8 +154,7 @@ module API
...
@@ -158,8 +154,7 @@ module API
build
=
Ci
::
Build
.
retry
(
build
,
current_user
)
build
=
Ci
::
Build
.
retry
(
build
,
current_user
)
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
,
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Erase build (remove artifacts and build trace)'
do
desc
'Erase build (remove artifacts and build trace)'
do
...
@@ -175,8 +170,7 @@ module API
...
@@ -175,8 +170,7 @@ module API
return
forbidden!
(
'Build is not erasable!'
)
unless
build
.
erasable?
return
forbidden!
(
'Build is not erasable!'
)
unless
build
.
erasable?
build
.
erase
(
erased_by:
current_user
)
build
.
erase
(
erased_by:
current_user
)
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
,
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
user_can_download_artifacts:
can?
(
current_user
,
:download_build_artifacts
,
user_project
)
end
end
desc
'Keep the artifacts to prevent them from being deleted'
do
desc
'Keep the artifacts to prevent them from being deleted'
do
...
@@ -194,8 +188,7 @@ module API
...
@@ -194,8 +188,7 @@ module API
build
.
keep_artifacts!
build
.
keep_artifacts!
status
200
status
200
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
,
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
desc
'Trigger a manual build'
do
desc
'Trigger a manual build'
do
...
@@ -215,8 +208,7 @@ module API
...
@@ -215,8 +208,7 @@ module API
build
.
play
(
current_user
)
build
.
play
(
current_user
)
status
200
status
200
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
,
present
build
,
with:
::
API
::
V3
::
Entities
::
Build
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
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