mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variable: removed __user.name/___.user.email from global variables and added docs for the rest of the __user variable. (#25275)
* added docs for new global variable. * reverting the name + email so we only expose the bare minumum that should be enough for most cases.
This commit is contained in:
@@ -15,8 +15,6 @@ export class User {
|
||||
timezone: string;
|
||||
helpFlags1: number;
|
||||
lightTheme: boolean;
|
||||
name?: string;
|
||||
email?: string;
|
||||
hasEditPermissionInFolders: boolean;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -73,9 +73,7 @@ export class VariableSrv {
|
||||
});
|
||||
this.templateSrv.setGlobalVariable('__user', {
|
||||
value: {
|
||||
name: contextSrv.user.name,
|
||||
login: contextSrv.user.login,
|
||||
email: contextSrv.user.email,
|
||||
id: contextSrv.user.id,
|
||||
toString: function() {
|
||||
return this.id;
|
||||
|
||||
@@ -104,9 +104,7 @@ export const completeDashboardTemplating = (dashboard: DashboardModel): ThunkRes
|
||||
});
|
||||
templateSrv.setGlobalVariable('__user', {
|
||||
value: {
|
||||
name: contextSrv.user.name,
|
||||
login: contextSrv.user.login,
|
||||
email: contextSrv.user.email,
|
||||
id: contextSrv.user.id,
|
||||
toString: function() {
|
||||
return this.id;
|
||||
|
||||
Reference in New Issue
Block a user