Commit 7a0f15e2 authored by Lukas Eipert's avatar Lukas Eipert Committed by Dmitriy Zaporozhets

Resolve "Operations navigation menu renders empty menu when user does not have...

Resolve "Operations navigation menu renders empty menu when user does not have the right permissions"
parent 79251271
...@@ -257,6 +257,9 @@ module ProjectsHelper ...@@ -257,6 +257,9 @@ module ProjectsHelper
if project.builds_enabled? && can?(current_user, :read_pipeline, project) if project.builds_enabled? && can?(current_user, :read_pipeline, project)
nav_tabs << :pipelines nav_tabs << :pipelines
end
if can?(current_user, :read_environment, project) || can?(current_user, :read_cluster, project)
nav_tabs << :operations nav_tabs << :operations
end end
......
...@@ -44,6 +44,18 @@ describe 'Projects > User sees sidebar' do ...@@ -44,6 +44,18 @@ describe 'Projects > User sees sidebar' do
expect(page).not_to have_content 'Repository' expect(page).not_to have_content 'Repository'
expect(page).not_to have_content 'CI / CD' expect(page).not_to have_content 'CI / CD'
expect(page).not_to have_content 'Merge Requests' expect(page).not_to have_content 'Merge Requests'
expect(page).not_to have_content 'Operations'
end
end
it 'shows build tab if builds are public' do
project.public_builds = true
project.save
visit project_path(project)
within('.nav-sidebar') do
expect(page).to have_content 'CI / CD'
end 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