mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: FGAC for alert rules page (#47418)
* Apply FGAC on the alert rules list page * Add tests for edit, delete and silence buttons * Unify access-control helpers * Fix import * Add route permissions for alert groups, unify access control helpers * Improve buttons with data source explore permission * Fix test
This commit is contained in:
@@ -9,6 +9,8 @@ import { AlertQuery } from 'app/types/unified-alerting-dto';
|
||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||
import { PanelPluginsButtonGroup, SupportedPanelPlugins } from '../PanelPluginsButtonGroup';
|
||||
import { TABLE, TIMESERIES } from '../../utils/constants';
|
||||
import { Authorize } from '../Authorize';
|
||||
import { AccessControlAction } from 'app/types';
|
||||
|
||||
type RuleViewerVisualizationProps = {
|
||||
data?: PanelData;
|
||||
@@ -91,20 +93,22 @@ export function RuleViewerVisualization(props: RuleViewerVisualizationProps): JS
|
||||
/>
|
||||
) : null}
|
||||
<PanelPluginsButtonGroup onChange={setPanel} value={panel} size="md" />
|
||||
{!isExpressionQuery(query.model) && (
|
||||
<>
|
||||
<div className={styles.spacing} />
|
||||
<LinkButton
|
||||
size="md"
|
||||
variant="secondary"
|
||||
icon="compass"
|
||||
target="_blank"
|
||||
href={createExploreLink(dsSettings, query)}
|
||||
>
|
||||
View in Explore
|
||||
</LinkButton>
|
||||
</>
|
||||
)}
|
||||
<Authorize actions={[AccessControlAction.DataSourcesExplore]}>
|
||||
{!isExpressionQuery(query.model) && (
|
||||
<>
|
||||
<div className={styles.spacing} />
|
||||
<LinkButton
|
||||
size="md"
|
||||
variant="secondary"
|
||||
icon="compass"
|
||||
target="_blank"
|
||||
href={createExploreLink(dsSettings, query)}
|
||||
>
|
||||
View in Explore
|
||||
</LinkButton>
|
||||
</>
|
||||
)}
|
||||
</Authorize>
|
||||
</div>
|
||||
</div>
|
||||
<PanelRenderer
|
||||
|
||||
Reference in New Issue
Block a user