summaryrefslogtreecommitdiff
path: root/app/views/projects
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-02-03 13:33:47 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-03 13:33:47 +0100
commitc3d897a9a382b0b3354d29726add5af8c322beb4 (patch)
treeccdbcb48accb064b09ad3fad77e1adeb3a6c5869 /app/views/projects
parente80c79e3ad0efe505541ebac0b149b750cd1cc60 (diff)
downloadgitlab-ce-c3d897a9a382b0b3354d29726add5af8c322beb4.tar.gz
Properly handle commit status permissions (for a build)
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/commit_statuses/_commit_status.html.haml8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/views/projects/commit_statuses/_commit_status.html.haml b/app/views/projects/commit_statuses/_commit_status.html.haml
index fba4405cb7d..c02c5983ac8 100644
--- a/app/views/projects/commit_statuses/_commit_status.html.haml
+++ b/app/views/projects/commit_statuses/_commit_status.html.haml
@@ -1,6 +1,6 @@
%tr.commit_status
%td.status
- - if commit_status.target_url
+ - if can?(current_user, :read_commit_status, commit_status) && commit_status.target_url
= link_to commit_status.target_url, class: "ci-status ci-#{commit_status.status}" do
= ci_icon_for_status(commit_status.status)
= commit_status.status
@@ -8,7 +8,7 @@
= ci_status_with_icon(commit_status.status)
%td.commit_status-link
- - if can?(current_user, :read_build, commit_status.project) && commit_status.target_url
+ - if can?(current_user, :read_commit_status, commit_status) && commit_status.target_url
= link_to commit_status.target_url do
%strong ##{commit_status.id}
- else
@@ -66,10 +66,10 @@
%td
.pull-right
- - if can?(current_user, :read_build, commit_status.project) && commit_status.artifacts_download_url
+ - if can?(current_user, :read_commit_status, commit_status) && commit_status.artifacts_download_url
= link_to commit_status.artifacts_download_url, title: 'Download artifacts' do
%i.fa.fa-download
- - if can?(current_user, :update_build, commit_status.project)
+ - if can?(current_user, :update_commit_status, commit_status)
- if commit_status.active?
- if commit_status.cancel_url
= link_to commit_status.cancel_url, method: :post, title: 'Cancel' do