`Secure` menu item for groups renders incorrect navigation when custom roles are enabled

Issue

  1. Create a custom role from /admin/application_settings/roles_and_permissions/new with Base role = Guest & Admin compliance framework permission enabled.
  2. Navigate to any group that you are an owner of. Go to Manage > Members and invite any user with that member role you just created.
  3. Log-in as that user you just invited and navigate to the group.
  4. You should see Secure > Compliance center in the navigation menu but you also see Security dashboard and Vulnerability report which you shouldn't.
  5. When you click on them, both of them result in a 404. Hence they are getting incorrectly displayed on the navigation menu.

Screenshot_2024-12-09_at_11.25.55_pm

Edited by Hinam Mehra