mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
AccessControl: "Add data source" button needs create and write rights to be enabled (#38934)
This commit is contained in:
parent
10ffc9a754
commit
e9631fdf7c
@ -71,7 +71,10 @@ export class DataSourcesListPage extends PureComponent<Props> {
|
||||
hasFetched,
|
||||
} = this.props;
|
||||
|
||||
const canCreateDataSource = contextSrv.hasPermission(AccessControlAction.DataSourcesCreate);
|
||||
const canCreateDataSource =
|
||||
contextSrv.hasPermission(AccessControlAction.DataSourcesCreate) &&
|
||||
contextSrv.hasPermission(AccessControlAction.DataSourcesWrite);
|
||||
|
||||
const linkButton = {
|
||||
href: 'datasources/new',
|
||||
title: 'Add data source',
|
||||
|
@ -8,7 +8,9 @@ import { AccessControlAction } from 'app/types';
|
||||
export const NoDataSourceCallToAction = () => {
|
||||
const theme = useTheme2();
|
||||
|
||||
const canCreateDataSource = contextSrv.hasPermission(AccessControlAction.DataSourcesCreate);
|
||||
const canCreateDataSource =
|
||||
contextSrv.hasPermission(AccessControlAction.DataSourcesCreate) &&
|
||||
contextSrv.hasPermission(AccessControlAction.DataSourcesWrite);
|
||||
|
||||
const message =
|
||||
'Explore requires at least one data source. Once you have added a data source, you can query it here.';
|
||||
|
Loading…
Reference in New Issue
Block a user