diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets.tsx index c65749178ddee..8d130c04bac5d 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react'; import { Redirect } from 'react-router-dom'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer, EuiCallOut } from '@elastic/eui'; import { groupBy } from 'lodash'; import type { ResolvedSimpleSavedObject } from '@kbn/core/public'; @@ -52,6 +52,7 @@ export const AssetsPage = ({ packageInfo }: AssetsPanelProps) => { const [assetSavedObjects, setAssetsSavedObjects] = useState(); const [fetchError, setFetchError] = useState(); const [isLoading, setIsLoading] = useState(true); + const [hasPermissionError, setHasPermissionError] = useState(false); useEffect(() => { const fetchAssetSavedObjects = async () => { @@ -94,6 +95,7 @@ export const AssetsPage = ({ packageInfo }: AssetsPanelProps) => { // Ignore privilege errors .catch((e: any) => { if (e?.body?.statusCode === 403) { + setHasPermissionError(true); return { resolved_objects: [] }; } else { throw e; @@ -161,6 +163,23 @@ export const AssetsPage = ({ packageInfo }: AssetsPanelProps) => { ); + } else if (hasPermissionError) { + content = ( + + } + > + + + ); } else if (assetSavedObjects === undefined || assetSavedObjects.length === 0) { if (customAssetsExtension) { // If a UI extension for custom asset entries is defined, render the custom component here despite