Commit d9cbee47 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'security-11-5-commit-status-shown-for-guest-user' into 'security-11-5'

[11.5]  Stop showing ci for guest users

See merge request gitlab/gitlabhq!2837

(cherry picked from commit ad1ab0b4ddfb94cbe3b987b556792edc18ac67eb)

d7095784 Stop showing ci for guest users
parent 0481f09b
......@@ -45,7 +45,7 @@
.prepend-top-0
- if project.archived
%span.prepend-left-10.badge.badge-warning archived
- if can?(current_user, :read_cross_project) && project.pipeline_status.has_status?
- if can?(current_user, :read_cross_project) && project.pipeline_status.has_status? && can?(current_user, :read_build, project)
%span.prepend-left-10
= render_project_pipeline_status(project.pipeline_status)
- if forks
......
---
title: Fix showing ci status for guest users when public pipline are not set
merge_request:
author:
type: security
......@@ -144,6 +144,27 @@ describe 'Dashboard Projects' do
expect(page).to have_link('Commit: passed')
end
end
context 'guest user of project and project has private pipelines' do
let(:guest_user) { create(:user) }
before do
project.update(public_builds: false)
project.add_guest(guest_user)
sign_in(guest_user)
end
it 'shows that the last pipeline passed' do
visit dashboard_projects_path
page.within('.controls') do
expect(page).not_to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit, ref: pipeline.ref)}']")
expect(page).not_to have_css('.ci-status-link')
expect(page).not_to have_css('.ci-status-icon-success')
expect(page).not_to have_link('Commit: passed')
end
end
end
end
context 'last push widget', :use_clean_rails_memory_store_caching do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment