mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Plugins: Expose functions to plugins for checking RBAC permissions (#89047)
* feat(grafana-data): create rbac functions for checking permissions * feat(grafana-runtime): pass current user to runtime * feat(grafana-runtime): expose rbac functions to check permissions against current user * refactor(contextsrv): use functions from grafana/data to check rbac permissions against user * Apply suggestions from code review Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * chore(rbac): fix missing types imports * refactor(rbac): make exposed functions return boolean --------- Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
This commit is contained in:
@@ -38,6 +38,7 @@ import {
|
||||
setReturnToPreviousHook,
|
||||
setPluginExtensionsHook,
|
||||
setPluginComponentHook,
|
||||
setCurrentUser,
|
||||
} from '@grafana/runtime';
|
||||
import { setPanelDataErrorView } from '@grafana/runtime/src/components/PanelDataErrorView';
|
||||
import { setPanelRenderer } from '@grafana/runtime/src/components/PanelRenderer';
|
||||
@@ -144,6 +145,7 @@ export class GrafanaApp {
|
||||
setEmbeddedDashboard(EmbeddedDashboardLazy);
|
||||
setTimeZoneResolver(() => config.bootData.user.timezone);
|
||||
initGrafanaLive();
|
||||
setCurrentUser(contextSrv.user);
|
||||
|
||||
initAuthConfig();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user