From 143bc5c4eabc90e28757bb6cda77a1a5f52967df Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Tue, 30 Nov 2021 16:26:05 -0700 Subject: [PATCH] Allow non-FGAC fallback to server admin role (#42175) --- public/app/core/services/context_srv.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/core/services/context_srv.ts b/public/app/core/services/context_srv.ts index 09e8ce1c731..deb0d0dda1c 100644 --- a/public/app/core/services/context_srv.ts +++ b/public/app/core/services/context_srv.ts @@ -74,7 +74,11 @@ export class ContextSrv { } hasRole(role: string) { - return this.user.orgRole === role; + if (role === 'ServerAdmin') { + return this.isGrafanaAdmin; + } else { + return this.user.orgRole === role; + } } accessControlEnabled(): boolean {