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
5b6202cc
Commit
5b6202cc
authored
Apr 06, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not show play action if user not allowed to run it
parent
3dbef510
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
lib/gitlab/ci/status/build/play.rb
lib/gitlab/ci/status/build/play.rb
+1
-1
spec/lib/gitlab/ci/status/build/play_spec.rb
spec/lib/gitlab/ci/status/build/play_spec.rb
+10
-2
No files found.
lib/gitlab/ci/status/build/play.rb
View file @
5b6202cc
...
...
@@ -10,7 +10,7 @@ module Gitlab
end
def
has_action?
can?
(
user
,
:update_build
,
subject
)
can?
(
user
,
:update_build
,
subject
)
&&
subject
.
can_play?
(
user
)
end
def
action_icon
...
...
spec/lib/gitlab/ci/status/build/play_spec.rb
View file @
5b6202cc
...
...
@@ -17,9 +17,17 @@ describe Gitlab::Ci::Status::Build::Play do
describe
'#has_action?'
do
context
'when user is allowed to update build'
do
before
{
build
.
project
.
team
<<
[
user
,
:developer
]
}
context
'when user can push to branch'
do
before
{
build
.
project
.
add_master
(
user
)
}
it
{
is_expected
.
to
have_action
}
it
{
is_expected
.
to
have_action
}
end
context
'when user can not push to the branch'
do
before
{
build
.
project
.
add_developer
(
user
)
}
it
{
is_expected
.
not_to
have_action
}
end
end
context
'when user is not allowed to update build'
do
...
...
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