Commit dcd70453 authored by Valery Sizov's avatar Valery Sizov

Fix: Guest sees some repository details and gets 404

parent 73ab9ba5
......@@ -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