Commit e77878bb by Daniel Lee

dashfolders: on folder page, hide tabs if not has admin permission

parent 61ed0b03
...@@ -90,7 +90,7 @@ export class AclCtrl { ...@@ -90,7 +90,7 @@ export class AclCtrl {
} }
return this.backendSrv.post(`/api/dashboards/id/${this.dashboard.id}/acl`, { return this.backendSrv.post(`/api/dashboards/id/${this.dashboard.id}/acl`, {
items: updated items: updated,
}); });
} }
...@@ -169,9 +169,9 @@ export function dashAclModal() { ...@@ -169,9 +169,9 @@ export function dashAclModal() {
bindToController: true, bindToController: true,
controllerAs: 'ctrl', controllerAs: 'ctrl',
scope: { scope: {
dashboard: "=", dashboard: '=',
meta: "=" meta: '=',
} },
}; };
} }
......
...@@ -50,15 +50,20 @@ export class FolderPageLoader { ...@@ -50,15 +50,20 @@ export class FolderPageLoader {
}); });
dashTab.url = folderUrl; dashTab.url = folderUrl;
if (result.meta.canAdmin) {
const permTab = _.find(ctrl.navModel.main.children, { const permTab = _.find(ctrl.navModel.main.children, {
id: 'manage-folder-permissions', id: 'manage-folder-permissions',
}); });
permTab.url = folderUrl + '/permissions'; permTab.url = folderUrl + '/permissions';
const settingsTab = _.find(ctrl.navModel.main.children, { const settingsTab = _.find(ctrl.navModel.main.children, {
id: 'manage-folder-settings', id: 'manage-folder-settings',
}); });
settingsTab.url = folderUrl + '/settings'; settingsTab.url = folderUrl + '/settings';
} else {
ctrl.navModel.main.children = [dashTab];
}
return result; return result;
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment