forked from grafana.jool/grafana-jool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
512 B
18 lines
512 B
import { config } from 'app/core/config';
|
|
import { contextSrv } from 'app/core/services/context_srv';
|
|
import { AccessControlAction } from 'app/types';
|
|
|
|
export function isGrafanaAdmin(): boolean {
|
|
return config.bootData.user.isGrafanaAdmin;
|
|
}
|
|
|
|
export function isOrgAdmin() {
|
|
return contextSrv.hasRole('Admin');
|
|
}
|
|
|
|
export function isDataSourceEditor() {
|
|
return (
|
|
contextSrv.hasPermission(AccessControlAction.DataSourcesCreate) &&
|
|
contextSrv.hasPermission(AccessControlAction.DataSourcesWrite)
|
|
);
|
|
}
|
|
|