mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
dashboard: show save as button if can edit and has edit permission to folders
This commit is contained in:
parent
770acee56a
commit
5c57c7cff5
@ -11,6 +11,7 @@ export class User {
|
||||
timezone: string;
|
||||
helpFlags1: number;
|
||||
lightTheme: boolean;
|
||||
hasEditPermissionInFolders: boolean;
|
||||
|
||||
constructor() {
|
||||
if (config.bootData.user) {
|
||||
@ -28,6 +29,7 @@ export class ContextSrv {
|
||||
isEditor: any;
|
||||
sidemenu: any;
|
||||
sidemenuSmallBreakpoint = false;
|
||||
hasEditPermissionInFolders: boolean;
|
||||
|
||||
constructor() {
|
||||
this.sidemenu = store.getBool('grafana.sidemenu', true);
|
||||
@ -44,6 +46,7 @@ export class ContextSrv {
|
||||
this.isSignedIn = this.user.isSignedIn;
|
||||
this.isGrafanaAdmin = this.user.isGrafanaAdmin;
|
||||
this.isEditor = this.hasRole('Editor') || this.hasRole('Admin');
|
||||
this.hasEditPermissionInFolders = this.user.hasEditPermissionInFolders;
|
||||
}
|
||||
|
||||
hasRole(role) {
|
||||
|
@ -30,7 +30,7 @@ export class SettingsCtrl {
|
||||
});
|
||||
});
|
||||
|
||||
this.canSaveAs = contextSrv.isEditor;
|
||||
this.canSaveAs = this.dashboard.meta.canEdit && contextSrv.hasEditPermissionInFolders;
|
||||
this.canSave = this.dashboard.meta.canSave;
|
||||
this.canDelete = this.dashboard.meta.canSave;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user