Skip to content

Commit

Permalink
show Service details link if user has apm read access
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiota committed Nov 28, 2023
1 parent 7b26c5f commit a18d779
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ export interface Props {

export function HeaderControl({ isLoading, slo }: Props) {
const {
application: { navigateToUrl },
application: { navigateToUrl, capabilities },
http: { basePath },
share: {
url: { locators },
},
triggersActionsUi: { getAddRuleFlyout: AddRuleFlyout },
} = useKibana().services;
const hasApmReadCapabilities = capabilities.apm.show;
const { hasWriteCapabilities } = useCapabilities();

const [isPopoverOpen, setIsPopoverOpen] = useState(false);
Expand Down Expand Up @@ -198,10 +199,11 @@ export function HeaderControl({ isLoading, slo }: Props) {
</EuiContextMenuItem>,
]
.concat(
!!slo && isApmIndicatorType(slo.indicator.type) && hasWriteCapabilities ? (
!!slo && isApmIndicatorType(slo.indicator.type) ? (
<EuiContextMenuItem
key="exploreInApm"
icon="bullseye"
disabled={!hasApmReadCapabilities}
onClick={handleNavigateToApm}
data-test-subj="sloDetailsHeaderControlPopoverExploreInApm"
>
Expand Down

0 comments on commit a18d779

Please sign in to comment.