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
Kazuhiko Shiozaki
gitlab-ce
Commits
3adfee1c
Commit
3adfee1c
authored
Oct 23, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow developer to manage builds
parent
127836dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
app/controllers/ci/application_controller.rb
app/controllers/ci/application_controller.rb
+0
-8
app/controllers/projects/builds_controller.rb
app/controllers/projects/builds_controller.rb
+7
-1
app/controllers/projects/commit_controller.rb
app/controllers/projects/commit_controller.rb
+10
-1
No files found.
app/controllers/ci/application_controller.rb
View file @
3adfee1c
...
@@ -8,14 +8,6 @@ module Ci
...
@@ -8,14 +8,6 @@ module Ci
private
private
def
authenticate_public_page!
unless
project
.
public
authenticate_user!
return
access_denied!
unless
can?
(
current_user
,
:read_project
,
gl_project
)
end
end
def
authenticate_token!
def
authenticate_token!
unless
project
.
valid_token?
(
params
[
:token
])
unless
project
.
valid_token?
(
params
[
:token
])
return
head
(
403
)
return
head
(
403
)
...
...
app/controllers/projects/builds_controller.rb
View file @
3adfee1c
...
@@ -2,7 +2,7 @@ class Projects::BuildsController < Projects::ApplicationController
...
@@ -2,7 +2,7 @@ class Projects::BuildsController < Projects::ApplicationController
before_action
:ci_project
before_action
:ci_project
before_action
:build
,
except:
[
:index
,
:cancel_all
]
before_action
:build
,
except:
[
:index
,
:cancel_all
]
before_action
:authorize_
admin_project
!
,
except:
[
:index
,
:show
,
:status
]
before_action
:authorize_
manage_builds
!
,
except:
[
:index
,
:show
,
:status
]
layout
"project"
layout
"project"
...
@@ -74,4 +74,10 @@ class Projects::BuildsController < Projects::ApplicationController
...
@@ -74,4 +74,10 @@ class Projects::BuildsController < Projects::ApplicationController
def
build_path
(
build
)
def
build_path
(
build
)
namespace_project_build_path
(
build
.
gl_project
.
namespace
,
build
.
gl_project
,
build
)
namespace_project_build_path
(
build
.
gl_project
.
namespace
,
build
.
gl_project
,
build
)
end
end
def
authorize_manage_builds!
unless
can?
(
current_user
,
:manage_builds
,
project
)
return
page_404
end
end
end
end
app/controllers/projects/commit_controller.rb
View file @
3adfee1c
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
class
Projects::CommitController
<
Projects
::
ApplicationController
class
Projects::CommitController
<
Projects
::
ApplicationController
# Authorize
# Authorize
before_action
:require_non_empty_project
before_action
:require_non_empty_project
before_action
:authorize_download_code!
before_action
:authorize_download_code!
,
except:
[
:cancel_builds
]
before_action
:authorize_manage_builds!
,
only:
[
:cancel_builds
]
before_action
:commit
before_action
:commit
def
show
def
show
...
@@ -55,4 +56,12 @@ class Projects::CommitController < Projects::ApplicationController
...
@@ -55,4 +56,12 @@ class Projects::CommitController < Projects::ApplicationController
def
commit
def
commit
@commit
||=
@project
.
commit
(
params
[
:id
])
@commit
||=
@project
.
commit
(
params
[
:id
])
end
end
private
def
authorize_manage_builds!
unless
can?
(
current_user
,
:manage_builds
,
project
)
return
page_404
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