Skip to content

Add blank group-level security configuration page, navigation

What does this MR do and why?

Add group-level security configuration page

Add feature flag, licensed feature, and custom ability
Add sidebar menu item that links to group security configuration page
Add page that renders a vue app with title and tab
Only show menu item and page if
- feature flag is enabled for the top-level group
- licensed feature is available
- user has admin_security_labels permission

References

Screenshots or screen recordings

Case Before After
feature flag enabled for the root group AND
licensed feature available AND
user authorized to admin_security_labels for the root group
no menu item, no page Screenshot_2025-06-26_at_13.44.04
feature flag disabled for the root group OR
licensed feature not available OR
user not authorized to admin_security_labels for the root group
no menu item, no page Screenshot_2025-06-26_at_13.48.48

How to set up and validate locally

  1. run this command with ID replaced by the ID of a root group that you have at least the maintainer role in:
    git checkout 550472-set-up-group-security-configuration-page-with-security-labels-tab
    echo "Feature.enable(:security_context_labels, Group.find(ID))" | gdk rails c
  2. navigate to the group or any of its subgroups
  3. in the sidebar choose Secure => Security configuration (new menu item)
  4. a Security configuration page should be shown with a single Security labels tab that contains only a description for now
  5. impersonate a user who has the developer role in the root group
    5. navigate to the group or any of its subgroups
    6. Secure => Security configuration should not be shown in the sidebar
    7. if you navigate to the page anyway (/groups/path/to/group/-/security/configuration), it should show 403: You do not have the permission to access this page
  6. if the feature flag is not enabled for the group's root ancestor group, the page should show 403: You do not have the permission to access this page
  7. if the group does not have a GitLab Ultimate license, the page should show 403: You do not have the permission to access this page

to run tests

bundle exec rspec ee/spec/helpers/groups/security_features_helper_spec.rb ee/spec/lib/sidebars/groups/menus/security_compliance_menu_spec.rb ee/spec/policies/group_policy_spec.rb ee/spec/requests/groups/security/configuration_controller_spec.rb

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hinam Mehra

Merge request reports

Loading