[v10.2.x] Identity: Fix org role none comparison (#77001)

Identity: Fix org role none comparison (#76999)

(cherry picked from commit a174e69c52)

Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2023-10-23 23:24:55 +03:00
committed by GitHub
co-authored by Juan Cabanas
parent 8f972a8f72
commit 684e1d4ce1
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ import { createRoot } from 'react-dom/client';
import {
locationUtil,
monacoLanguageRegistry,
OrgRole,
setLocale,
setTimeZoneResolver,
setWeekStart,
@@ -279,7 +280,7 @@ function initEchoSrv() {
}
});
if (contextSrv.user.orgRole !== '') {
if (contextSrv.user.orgRole !== OrgRole.None) {
registerEchoBackend(new PerformanceBackend({}));
}
@@ -2,7 +2,7 @@ import { css } from '@emotion/css';
import React, { PureComponent } from 'react';
import { Unsubscribable } from 'rxjs';
import { GrafanaTheme2 } from '@grafana/data';
import { GrafanaTheme2, OrgRole } from '@grafana/data';
import { config, getGrafanaLiveSrv } from '@grafana/runtime';
import { Alert, stylesFactory } from '@grafana/ui';
import { contextSrv } from 'app/core/services/context_srv';
@@ -46,7 +46,7 @@ export class LiveConnectionWarning extends PureComponent<Props, State> {
render() {
const { show } = this.state;
if (show) {
if (!contextSrv.isSignedIn || !config.liveEnabled || contextSrv.user.orgRole === '') {
if (!contextSrv.isSignedIn || !config.liveEnabled || contextSrv.user.orgRole === OrgRole.None) {
return null; // do not show the warning for anonymous users or ones with no org (and /login page etc)
}