2020-05-20 10:15:37 +00:00
|
|
|
Ext.define('PBS.window.ACLEdit', {
|
|
|
|
extend: 'Proxmox.window.Edit',
|
|
|
|
alias: 'widget.pbsACLAdd',
|
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
|
2020-09-21 11:25:48 +00:00
|
|
|
onlineHelp: 'user_acl',
|
|
|
|
|
2020-05-20 10:15:37 +00:00
|
|
|
url: '/access/acl',
|
|
|
|
method: 'PUT',
|
|
|
|
isAdd: true,
|
|
|
|
isCreate: true,
|
2020-07-25 18:10:06 +00:00
|
|
|
width: 450,
|
2020-05-20 10:15:37 +00:00
|
|
|
|
|
|
|
// caller can give a static path
|
|
|
|
path: undefined,
|
2022-05-14 12:50:38 +00:00
|
|
|
defaultFocus: 'proxmoxcheckbox',
|
2020-05-20 10:15:37 +00:00
|
|
|
|
2020-10-28 10:07:27 +00:00
|
|
|
initComponent: function() {
|
2020-05-20 10:15:37 +00:00
|
|
|
let me = this;
|
|
|
|
|
2020-10-28 10:07:27 +00:00
|
|
|
me.items = [];
|
2020-05-20 10:15:37 +00:00
|
|
|
|
2020-10-28 10:07:27 +00:00
|
|
|
me.items.push({
|
2022-05-18 16:09:15 +00:00
|
|
|
xtype: 'pbsPermissionPathSelector',
|
2020-11-10 07:19:17 +00:00
|
|
|
name: 'path',
|
2020-05-20 10:15:37 +00:00
|
|
|
fieldLabel: gettext('Path'),
|
2022-05-18 16:09:15 +00:00
|
|
|
allowBlank: false,
|
|
|
|
//editable: !me.path,
|
2020-10-28 10:07:27 +00:00
|
|
|
value: me.path,
|
2022-05-18 16:09:15 +00:00
|
|
|
datastore: me.datastore,
|
2020-10-28 10:07:27 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
if (me.aclType === 'user') {
|
|
|
|
me.subject = gettext('User Permission');
|
|
|
|
me.items.push({
|
2021-11-17 08:27:21 +00:00
|
|
|
xtype: 'pmxUserSelector',
|
2020-10-30 14:18:41 +00:00
|
|
|
name: 'auth-id',
|
2020-11-10 07:19:17 +00:00
|
|
|
fieldLabel: gettext('User'),
|
2020-10-28 10:07:27 +00:00
|
|
|
allowBlank: false,
|
|
|
|
});
|
|
|
|
} else if (me.aclType === 'token') {
|
|
|
|
me.subject = gettext('API Token Permission');
|
|
|
|
me.items.push({
|
|
|
|
xtype: 'pbsTokenSelector',
|
2020-10-30 14:18:41 +00:00
|
|
|
name: 'auth-id',
|
2020-11-10 07:19:17 +00:00
|
|
|
fieldLabel: gettext('API Token'),
|
2020-10-28 10:07:27 +00:00
|
|
|
allowBlank: false,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
me.items.push({
|
2020-05-20 10:15:37 +00:00
|
|
|
xtype: 'pmxRoleSelector',
|
|
|
|
name: 'role',
|
|
|
|
fieldLabel: gettext('Role'),
|
2020-11-10 07:19:17 +00:00
|
|
|
value: 'NoAccess',
|
2020-10-28 10:07:27 +00:00
|
|
|
});
|
|
|
|
me.items.push({
|
2020-05-20 10:15:37 +00:00
|
|
|
xtype: 'proxmoxcheckbox',
|
|
|
|
name: 'propagate',
|
2020-11-10 07:19:17 +00:00
|
|
|
fieldLabel: gettext('Propagate'),
|
2020-05-20 10:15:37 +00:00
|
|
|
checked: true,
|
|
|
|
uncheckedValue: 0,
|
2020-10-28 10:07:27 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
me.callParent();
|
|
|
|
},
|
2020-05-20 10:15:37 +00:00
|
|
|
});
|