www: show more ACLs in datastore panel

since just the ACLs defined on the exact datastore path don't give
anywhere near a complete picture of who has access to it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2020-11-09 14:47:38 +01:00 committed by Thomas Lamprecht
parent 8f7cd96df4
commit f3b4820d06
2 changed files with 19 additions and 2 deletions

View File

@ -84,11 +84,29 @@ Ext.define('PBS.config.ACLView', {
let params = {};
if (view.aclPath !== undefined) {
params.path = view.aclPath;
let pathFilter = Ext.create('Ext.util.Filter', {
filterPath: view.aclPath,
filterFn: function(item) {
let me = this;
let curr = item.data.path;
if (curr.lastIndexOf("/") < me.filterPath.lastIndexOf("/")) {
return me.filterPath.startsWith(curr);
} else {
return me.filterPath === curr;
}
},
});
view.getStore().addFilter(pathFilter);
}
if (view.aclExact !== undefined) {
if (view.aclPath !== undefined) {
params.path = view.aclPath;
}
params.exact = view.aclExact;
}
proxy.setExtraParams(params);
Proxmox.Utils.monStoreErrors(view, view.getStore().rstore);
},

View File

@ -90,7 +90,6 @@ Ext.define('PBS.DataStorePanel', {
itemId: 'acl',
xtype: 'pbsACLView',
iconCls: 'fa fa-unlock',
aclExact: true,
cbind: {
aclPath: '{aclPath}',
},