diff --git a/src/components/Sidebar/B4aSidebar.react.js b/src/components/Sidebar/B4aSidebar.react.js index b915164b7..2878b3c42 100644 --- a/src/components/Sidebar/B4aSidebar.react.js +++ b/src/components/Sidebar/B4aSidebar.react.js @@ -139,7 +139,7 @@ const B4aSidebar = ({ } return (
- {subsections.map(({ name, link, badge, children: groupChildren }) => { + {subsections.map(({ name, link, badge, gated, children: groupChildren }) => { if (groupChildren) { const isGroupActive = subsection === name || groupChildren.some(c => c.name === subsection); const groupLink = link.startsWith('/') ? prefix + link : link; @@ -189,6 +189,8 @@ const B4aSidebar = ({ } const active = subsection === name; + // Opt-in: only items flagged `gated` are locked when the app is unreachable. + const itemDisabled = gated ? !canAccess(currentApp.serverInfo, link.replace(/^\//, '')) : false; link = link.startsWith('/') ? prefix + link : link; return ( {active ? children : null} diff --git a/src/dashboard/DashboardView.react.js b/src/dashboard/DashboardView.react.js index cad4cb0cb..e1aea4d9a 100644 --- a/src/dashboard/DashboardView.react.js +++ b/src/dashboard/DashboardView.react.js @@ -161,7 +161,8 @@ export default class DashboardView extends React.Component { cloudCodeSubSections.push({ name: 'Config', - link: '/config' + link: '/config', + gated: true }); // if (!isLocked && features.logs && Object.keys(features.logs).some(key => features.logs[key])) { diff --git a/src/lib/serverInfo.js b/src/lib/serverInfo.js index 688d522b3..e0b6b7721 100644 --- a/src/lib/serverInfo.js +++ b/src/lib/serverInfo.js @@ -1,5 +1,10 @@ export const ALWAYS_ALLOWED_ROUTES = [ 'overview', + 'Cloud Code', + 'cloud_code', + 'jobs', + 'deployments', + 'webhooks', 'web-deployment', 'Overview', 'Web Deployment',