[permissions] Place lab + billing behind settings/workspace permission gates (#10354)
This commit is contained in:
@ -421,7 +421,15 @@ export const SettingsRoutes = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<Route path={SettingsPath.Lab} element={<SettingsLab />} />
|
||||
<Route
|
||||
element={
|
||||
<SettingsProtectedRouteWrapper
|
||||
settingsPermission={SettingsFeatures.WORKSPACE}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Route path={SettingsPath.Lab} element={<SettingsLab />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
</Suspense>
|
||||
);
|
||||
|
||||
@ -117,7 +117,8 @@ export const useSettingsNavigationItems = (): SettingsNavigationSection[] => {
|
||||
label: t`Billing`,
|
||||
path: SettingsPath.Billing,
|
||||
Icon: IconCurrencyDollar,
|
||||
isHidden: !isBillingEnabled,
|
||||
isHidden:
|
||||
!isBillingEnabled || !permissionMap[SettingsFeatures.WORKSPACE],
|
||||
},
|
||||
{
|
||||
label: t`Roles`,
|
||||
@ -181,7 +182,9 @@ export const useSettingsNavigationItems = (): SettingsNavigationSection[] => {
|
||||
label: t`Lab`,
|
||||
path: SettingsPath.Lab,
|
||||
Icon: IconFlask,
|
||||
isHidden: !labPublicFeatureFlags.length,
|
||||
isHidden:
|
||||
!labPublicFeatureFlags.length ||
|
||||
!permissionMap[SettingsFeatures.WORKSPACE],
|
||||
},
|
||||
{
|
||||
label: t`Releases`,
|
||||
|
||||
Reference in New Issue
Block a user