pve-manager/www/manager6/form/PrivilegesSelector.js
René Jochum 9265782932 fixes #1503 Add role CRUD to the GUI.
As given in the subject this implements role create/update/delete over
the manager.

There's currently no coler highlightning for "special" roles.

Signed-off-by: René Jochum <r.jochum@proxmox.com>
2018-05-08 15:54:22 +02:00

36 lines
695 B
JavaScript

Ext.define('PVE.form.PrivilegesSelector', {
extend: 'Proxmox.form.KVComboBox',
xtype: 'pvePrivilegesSelector',
multiSelect: true,
initComponent: function() {
var me = this;
// So me.store is available.
me.callParent();
Proxmox.Utils.API2Request({
url: '/access/roles/Administrator',
method: 'GET',
success: function(response, options) {
var data = [];
for (var key in response.result.data) {
data.push([key, key]);
}
me.store.setData(data);
me.store.sort({
property: 'key',
direction: 'ASC'
});
},
failure: function (response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
}
});
}
});