diff --git a/pkg/services/navtree/navtreeimpl/navtree.go b/pkg/services/navtree/navtreeimpl/navtree.go index e53356c0997..69bd5de2aec 100644 --- a/pkg/services/navtree/navtreeimpl/navtree.go +++ b/pkg/services/navtree/navtreeimpl/navtree.go @@ -409,13 +409,15 @@ func (s *ServiceImpl) buildAlertNavLinks(c *contextmodel.ReqContext) *navtree.Na } if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagAlertingCentralAlertHistory) { - alertChildNavs = append(alertChildNavs, &navtree.NavLink{ - Text: "History", - SubTitle: "History of events that were generated by your Grafana-managed alert rules. Silences and Mute timings are ignored.", - Id: "alerts-history", - Url: s.cfg.AppSubURL + "/alerting/history", - Icon: "history", - }) + if hasAccess(ac.EvalAny(ac.EvalPermission(ac.ActionAlertingRuleRead))) { + alertChildNavs = append(alertChildNavs, &navtree.NavLink{ + Text: "History", + SubTitle: "View a history of all alert events generated by your Grafana-managed alert rules. All alert events are displayed regardless of whether silences or mute timings are set.", + Id: "alerts-history", + Url: s.cfg.AppSubURL + "/alerting/history", + Icon: "history", + }) + } } if c.SignedInUser.GetOrgRole() == org.RoleAdmin { diff --git a/public/app/features/alerting/routes.tsx b/public/app/features/alerting/routes.tsx index 23031c03dc4..82a46aeacba 100644 --- a/public/app/features/alerting/routes.tsx +++ b/public/app/features/alerting/routes.tsx @@ -168,10 +168,7 @@ export function getAlertingRoutes(cfg = config): RouteDescriptor[] { }, { path: '/alerting/history/', - roles: evaluateAccess([ - AccessControlAction.AlertingInstanceRead, - AccessControlAction.AlertingInstancesExternalRead, - ]), + roles: evaluateAccess([AccessControlAction.AlertingRuleRead]), component: importAlertingComponent( () => import( diff --git a/public/app/features/alerting/unified/components/AlertLabels.tsx b/public/app/features/alerting/unified/components/AlertLabels.tsx index 5083e7c6f29..651dadb49e5 100644 --- a/public/app/features/alerting/unified/components/AlertLabels.tsx +++ b/public/app/features/alerting/unified/components/AlertLabels.tsx @@ -15,9 +15,10 @@ interface Props { labels: Record; commonLabels?: Record; size?: LabelSize; + onClick?: (label: string, value: string) => void; } -export const AlertLabels = ({ labels, commonLabels = {}, size }: Props) => { +export const AlertLabels = ({ labels, commonLabels = {}, size, onClick }: Props) => { const styles = useStyles2(getStyles, size); const [showCommonLabels, setShowCommonLabels] = useState(false); @@ -33,9 +34,19 @@ export const AlertLabels = ({ labels, commonLabels = {}, size }: Props) => { return (
- {labelsToShow.map(([label, value]) => ( -