Hide new role button on roles and permissions page for Premium license
What does this MR do and why?
On the Admin area -> Roles and permissions page, or the top-level group -> Roles and permissions page, a New role button is shown:
| Admin area R&P page | Top-level group R&P page |
|---|---|
![]() |
![]() |
The R&P page is available for Premium and Ultimate licenses, but the custom roles feature is only available for Ultimate. For Premium, the page should only show standard roles, with no ability to create custom roles. This MR fixes the following bugs:
-
Fixed the
New rolebutton incorrectly showing forPremiumlicenses:Before After 

Note that this is a display bug; even without the bugfix, it will show a 404 page when the button is clicked. The bugfix simply hides the button.
-
Fixed the
New rolebutton incorrectly hidden for the SaaS admin page, it's now shown. -
Fixed a bug where the admin area Roles and permissions sidebar menu item was shown when in SaaS mode and the
custom_admin_rolesfeature flag is off. For SaaS, the admin area R&P page only shows custom admin roles, so with the feature flag off the sidebar item menu item shouldn't be shown:Before After 

Like the above bug, this is a display bug only; even without the bugfix, clicking on the menu item will show a 404 page.
How to set up and validate locally
You will need a self-managed Premium license. Follow this handbook page on how to acquire one. There are 5 situations we need to verify:
- For self-managed on an Ultimate license, the
New rolebutton is shown:
- For self-managed on a Premium license, the `New role button is not shown:
For the SaaS tests, follow this setup video:
- For SaaS for a top-level group on an Ultimate license, the
New rolebutton is shown:
- For SaaS for a top-level group on a Premium license, the
New rolebutton is not shown:
- For SaaS, when viewing the admin area, the Roles and permission sidebar item is only shown when the
custom_admin_rolesfeature flag is enabled:
Related to #546035 (closed)





