Skip to content

Commit

Permalink
prevent users from accessing the url if the feature flag is not turne…
Browse files Browse the repository at this point in the history
…d on
  • Loading branch information
PhilippeOberti committed Oct 1, 2024
1 parent 9fbd376 commit a5735d7
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Routes, Route } from '@kbn/shared-ux-router';
import { TrackApplicationView } from '@kbn/usage-collection-plugin/public';
import { EuiEmptyPrompt, EuiLoadingLogo } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useIsExperimentalFeatureEnabled } from '../../common/hooks/use_experimental_features';
import { NotesContainer } from './notes';
import { ManagementEmptyStateWrapper } from '../components/management_empty_state_wrapper';
import {
Expand Down Expand Up @@ -87,6 +88,10 @@ const NotesTelemetry = () => (
);

export const ManagementContainer = memo(() => {
const securitySolutionNotesEnabled = useIsExperimentalFeatureEnabled(
'securitySolutionNotesEnabled'
);

const {
loading,
canReadPolicyManagement,
Expand Down Expand Up @@ -157,7 +162,9 @@ export const ManagementContainer = memo(() => {
hasPrivilege={canReadActionsLogManagement}
/>

<Route path={MANAGEMENT_ROUTING_NOTES_PATH} component={NotesTelemetry} />
{securitySolutionNotesEnabled && (
<Route path={MANAGEMENT_ROUTING_NOTES_PATH} component={NotesTelemetry} />
)}

{canReadEndpointList && (
<Route path={MANAGEMENT_PATH} exact>
Expand Down

0 comments on commit a5735d7

Please sign in to comment.