Commit 856ef3c3 authored by Sean McGivern's avatar Sean McGivern

Merge branch '24056-guest-sees-some-project-details-and-gets-404' into 'master'

Fix: Guest sees some repository details and gets 404

Closes #24056

See merge request !7222
parents 5ef2bd19 dcd70453
......@@ -12,7 +12,7 @@
= render 'projects/last_push'
= render "home_panel"
- if @project.feature_available?(:repository, current_user)
- if current_user && can?(current_user, :download_code, @project)
%nav.project-stats{ class: container_class }
%ul.nav
%li
......
---
title: 'Fix: Guest sees some repository details and gets 404'
merge_request:
author:
......@@ -183,4 +183,19 @@ describe 'Edit Project Settings', feature: true do
end
end
end
# Regression spec for https://gitlab.com/gitlab-org/gitlab-ce/issues/24056
describe 'project statistic visibility' do
let!(:project) { create(:project, :private) }
before do
project.team << [member, :guest]
login_as(member)
visit namespace_project_path(project.namespace, project)
end
it "does not show project statistic for guest" do
expect(page).not_to have_selector('.project-stats')
end
end
end
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