Skip to content

Check if security_and_compliance is enabled

Kenneth Chu requested to merge kenneth-security-sidebar-disabled into master

What does this MR do and why?

I believe a bug was introduced in MR Fix Security navigation for users with custom role (!121736 - merged), where the Security and Compliance sidebar item will always show up in the sidebar, even if Security and Compliance is disabled within a project.

The sidebar item would then show sub-items that all confusingly link to a 404, because the feature is not enabled on the project, such as the Vulernability Report and Audit Events.

This MR checks if Security and Compliance is disabled within a project, and will not show the Secure sidebar item if it is.


NOTE: A SaaS Customer with an Ultimate Subscription ran into this problem in this internal ZD ticket.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before (with Security and Compliance is disabled) After (with Security and Compliance is disabled)
image image

How to set up and validate locally

  1. Create a new project
  2. Go to Settings > General > Visibility, project features, permissions
  3. Disable Security and Compliance
  4. Observe Security and Compliance sidebar item should no longer show up.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Kenneth Chu

Merge request reports