Skip to content

Hide roles and permissions page from admin area when in SaaS mode

What does this MR do and why?

  • When SaaS mode is on, an admin cannot configure instance-level custom roles. However, we will render the Roles and Permissions item in the Settings menu and render the page only with an error message.
  • This MR hides the menu from the sidebar and renders a 404 if SaaS mode is on.

MR acceptance checklist

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

Screenshots or screen recordings

Context Before After
Page before after
Sidebar

How to set up and validate locally

  1. Turn on SaaS mode with:
export GITLAB_SIMULATE_SAAS=1
gdk restart
  1. Log-in as admin and navigate to /admin/application_settings/roles_and_permissions. This should result in a 404. You should also not see any Roles and Permissions item in the Settings menu.

  2. Turn off SaaS mode with:

export GITLAB_SIMULATE_SAAS=0
gdk restart
  1. Refresh the page. You should see /admin/application_settings/roles_and_permissions and see a menu-item for it in the sidebar under Settings.

Related to #442296 (closed)

Edited by Hinam Mehra

Merge request reports