diff --git a/public/app/core/services/backend_srv.ts b/public/app/core/services/backend_srv.ts
index 0dc6d07dc53..436da136406 100644
--- a/public/app/core/services/backend_srv.ts
+++ b/public/app/core/services/backend_srv.ts
@@ -220,7 +220,7 @@ export class BackendSrv {
createDashboardFolder(name) {
const dash = {
title: name,
- editable: false,
+ editable: true,
hideControls: true,
rows: [
{
@@ -228,22 +228,33 @@ export class BackendSrv {
{
folderId: 0,
headings: false,
- id: 1,
limit: 1000,
links: [],
query: '',
recent: false,
search: true,
- span: 12,
+ span: 4,
starred: false,
tags: [],
- title: 'Dashboards',
+ title: 'Dashboards in this folder',
type: 'dashlist'
+ },
+ {
+ onlyAlertsOnDashboard: true,
+ span: 4,
+ title: 'Alerts in this folder',
+ type: 'alertlist'
+ },
+ {
+ span: 4,
+ title: 'Permissions for this folder',
+ type: 'permissionlist',
+ folderId: 0
}
],
- showTitle: false,
- title: 'Dashboard List',
- titleSize: 'h6'
+ showTitle: true,
+ title: name,
+ titleSize: 'h1'
}
]
};
@@ -254,6 +265,7 @@ export class BackendSrv {
})
.then(res => {
res.dashboard.rows[0].panels[0].folderId = res.dashboard.id;
+ res.dashboard.rows[0].panels[2].folderId = res.dashboard.id;
return this.saveDashboard(res.dashboard, {overwrite: false});
});
}
diff --git a/public/app/plugins/panel/permissionlist/editor.html b/public/app/plugins/panel/permissionlist/editor.html
new file mode 100644
index 00000000000..fc29351f4d2
--- /dev/null
+++ b/public/app/plugins/panel/permissionlist/editor.html
@@ -0,0 +1,13 @@
+
diff --git a/public/app/plugins/panel/permissionlist/img/icn-singlestat-panel.svg b/public/app/plugins/panel/permissionlist/img/icn-singlestat-panel.svg
new file mode 100644
index 00000000000..d6ba04bbf01
--- /dev/null
+++ b/public/app/plugins/panel/permissionlist/img/icn-singlestat-panel.svg
@@ -0,0 +1,75 @@
+
+
+
diff --git a/public/app/plugins/panel/permissionlist/module.html b/public/app/plugins/panel/permissionlist/module.html
new file mode 100644
index 00000000000..a98c1bd75b8
--- /dev/null
+++ b/public/app/plugins/panel/permissionlist/module.html
@@ -0,0 +1,30 @@
+
+
+ -
+
+
+
+
+
{{permission.userLogin}}
+
+
+
+
+
+ -
+
+
+
+
+
{{permission.userGroup}}
+
+
+
+
+
+
+
diff --git a/public/app/plugins/panel/permissionlist/module.ts b/public/app/plugins/panel/permissionlist/module.ts
new file mode 100644
index 00000000000..94704e90afd
--- /dev/null
+++ b/public/app/plugins/panel/permissionlist/module.ts
@@ -0,0 +1,60 @@
+///
+
+import _ from 'lodash';
+import config from 'app/core/config';
+import {PanelCtrl} from 'app/plugins/sdk';
+import {impressions} from 'app/features/dashboard/impression_store';
+
+class PermissionListCtrl extends PanelCtrl {
+ static templateUrl = 'module.html';
+
+ userPermissions: any[];
+ userGroupPermissions: any[];
+ roles: any[];
+
+ panelDefaults = {
+ folderId: 0
+ };
+
+ /** @ngInject */
+ constructor($scope, $injector, private backendSrv) {
+ super($scope, $injector);
+ _.defaults(this.panel, this.panelDefaults);
+
+ this.events.on('refresh', this.onRefresh.bind(this));
+ this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
+
+ this.getPermissions();
+ }
+
+ onInitEditMode() {
+ this.editorTabIndex = 1;
+ this.addEditorTab('Options', 'public/app/plugins/panel/permissionlist/editor.html');
+ }
+
+ onRefresh() {
+ var promises = [];
+
+ promises.push(this.getPermissions());
+
+ return Promise.all(promises)
+ .then(this.renderingCompleted.bind(this));
+ }
+
+ onFolderChange(folder: any) {
+ this.panel.folderId = folder.id;
+ this.refresh();
+ }
+
+ getPermissions() {
+ return this.backendSrv.get(`/api/dashboards/id/${this.panel.folderId}/acl`)
+ .then(result => {
+ this.userPermissions = _.filter(result, p => { return p.userId > 0;});
+ this.userGroupPermissions = _.filter(result, p => { return p.userGroupId > 0;});
+ // this.roles = this.setRoles(result);
+ });
+ }
+
+}
+
+export {PermissionListCtrl, PermissionListCtrl as PanelCtrl};
diff --git a/public/app/plugins/panel/permissionlist/plugin.json b/public/app/plugins/panel/permissionlist/plugin.json
new file mode 100644
index 00000000000..c52ac54c79c
--- /dev/null
+++ b/public/app/plugins/panel/permissionlist/plugin.json
@@ -0,0 +1,16 @@
+{
+ "type": "panel",
+ "name": "Permission List",
+ "id": "permissionlist",
+
+ "info": {
+ "author": {
+ "name": "Grafana Project",
+ "url": "https://grafana.com"
+},
+ "logos": {
+ "small": "img/icn-singlestat-panel.svg",
+ "large": "img/icn-singlestat-panel.svg"
+ }
+ }
+}