From e7b4abdd3ab7b144f8f154ca21c91d534929be8f Mon Sep 17 00:00:00 2001 From: Celine Sebe Date: Wed, 4 Mar 2026 10:35:18 +0100 Subject: [PATCH] [backend]fixes --- .../src/private/components/nav/LeftBar.jsx | 6 +++- .../src/private/components/settings/Root.tsx | 29 +++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/opencti-platform/opencti-front/src/private/components/nav/LeftBar.jsx b/opencti-platform/opencti-front/src/private/components/nav/LeftBar.jsx index b4cebb11cb7b..db73dc15fcc2 100644 --- a/opencti-platform/opencti-front/src/private/components/nav/LeftBar.jsx +++ b/opencti-platform/opencti-front/src/private/components/nav/LeftBar.jsx @@ -96,8 +96,10 @@ import useGranted, { SETTINGS_FILEINDEXING, SETTINGS_SECURITYACTIVITY, SETTINGS_SETACCESSES, + SETTINGS_SETAUTH, SETTINGS_SETCASETEMPLATES, SETTINGS_SETCUSTOMIZATION, + SETTINGS_SETDISSEMINATION, SETTINGS_SETKILLCHAINPHASES, SETTINGS_SETLABELS, SETTINGS_SETMANAGEXTMHUB, @@ -248,7 +250,7 @@ const LeftBarComponent = ({ queryRef }) => { const isGrantedToIngestion = useGranted([MODULES, INGESTION, INGESTION_SETINGESTIONS]); const isOrganizationAdmin = useGranted([VIRTUAL_ORGANIZATION_ADMIN]); const isGrantedToCustomization = useGranted([SETTINGS_SETCUSTOMIZATION]); - const isGrantedToSecurity = useGranted([SETTINGS_SETMARKINGS, SETTINGS_SETACCESSES]); + const isGrantedToSecurity = useGranted([SETTINGS_SETMARKINGS, SETTINGS_SETACCESSES, SETTINGS_SETDISSEMINATION, SETTINGS_SETAUTH]); const isGrantedToAudit = useGranted([SETTINGS_SECURITYACTIVITY]); const isGrantedToExplore = useGranted([EXPLORE]); const hasXtmHubAccess = useGranted([SETTINGS_SETMANAGEXTMHUB]); @@ -747,7 +749,9 @@ const LeftBarComponent = ({ queryRef }) => { VIRTUAL_ORGANIZATION_ADMIN, SETTINGS_SETPARAMETERS, SETTINGS_SETACCESSES, + SETTINGS_SETAUTH, SETTINGS_SETMARKINGS, + SETTINGS_SETDISSEMINATION, SETTINGS_SETCUSTOMIZATION, SETTINGS_SETLABELS, SETTINGS_SETVOCABULARIES, diff --git a/opencti-platform/opencti-front/src/private/components/settings/Root.tsx b/opencti-platform/opencti-front/src/private/components/settings/Root.tsx index 068c701ab4bd..4129505cb6dd 100644 --- a/opencti-platform/opencti-front/src/private/components/settings/Root.tsx +++ b/opencti-platform/opencti-front/src/private/components/settings/Root.tsx @@ -61,9 +61,32 @@ const FintelDesigns = lazy(() => import('./fintel_design/FintelDesigns')); const FintelDesign = lazy(() => import('./fintel_design/FintelDesign')); const Experience = lazy(() => import('./Experience')); -const Root = () => { +const AccessesRedirect = () => { const adminOrga = isOnlyOrganizationAdmin(); + const hasSetAccesses = useGranted([SETTINGS_SETACCESSES]); + const hasVirtualOrgAdmin = useGranted([VIRTUAL_ORGANIZATION_ADMIN]); + const hasSetMarkings = useGranted([SETTINGS_SETMARKINGS]); + const hasSetDissemination = useGranted([SETTINGS_SETDISSEMINATION]); + const hasSetAuth = useGranted([SETTINGS_SETAUTH]); + if (hasSetAccesses) { + return ; + } + if (hasVirtualOrgAdmin) { + return ; + } + if (hasSetAuth) { + return ; + } + if (hasSetMarkings) { + return ; + } + if (hasSetDissemination) { + return ; + } + return ; +}; +const Root = () => { const isGrantedToLabels = useGranted([SETTINGS_SETLABELS]); const isGrantedToVocabularies = useGranted([SETTINGS_SETVOCABULARIES]); const isGrantedToKillChainPhases = useGranted([SETTINGS_SETKILLCHAINPHASES]); @@ -124,10 +147,10 @@ const Root = () => { path="/accesses" element={( } > - + )} />