Resolve "Operations navigation menu renders empty menu when user does not have the right permissions"
This commit is contained in:
parent
7925127180
commit
7a0f15e2c6
|
@ -257,6 +257,9 @@ module ProjectsHelper
|
|||
|
||||
if project.builds_enabled? && can?(current_user, :read_pipeline, project)
|
||||
nav_tabs << :pipelines
|
||||
end
|
||||
|
||||
if can?(current_user, :read_environment, project) || can?(current_user, :read_cluster, project)
|
||||
nav_tabs << :operations
|
||||
end
|
||||
|
||||
|
|
|
@ -44,6 +44,18 @@ describe 'Projects > User sees sidebar' do
|
|||
expect(page).not_to have_content 'Repository'
|
||||
expect(page).not_to have_content 'CI / CD'
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue