]> git.proxmox.com Git - proxmox-backup.git/blob - www/window/ACLEdit.js
ui: acl: add improved permission selector
[proxmox-backup.git] / www / window / ACLEdit.js
1 Ext.define('PBS.window.ACLEdit', {
2 extend: 'Proxmox.window.Edit',
3 alias: 'widget.pbsACLAdd',
4 mixins: ['Proxmox.Mixin.CBind'],
5
6 url: '/access/acl',
7 method: 'PUT',
8 isAdd: true,
9 isCreate: true,
10 width: 450,
11
12 // caller can give a static path
13 path: undefined,
14
15 subject: gettext('User Permission'),
16
17 getValues: function(dirtyOnly) {
18 let me = this;
19 let values = me.callParent(arguments);
20
21 if (me.path) {
22 values.path = me.path;
23 }
24 return values;
25 },
26
27 items: [
28 {
29 xtype: 'pbsPermissionPathSelector',
30 fieldLabel: gettext('Path'),
31 cbind: {
32 editable: '{!path}',
33 value: '{path}',
34 },
35 name: 'path',
36 allowBlank: false,
37 },
38 {
39 xtype: 'pbsUserSelector',
40 fieldLabel: gettext('User'),
41 name: 'userid',
42 allowBlank: false,
43 },
44 {
45 xtype: 'pmxRoleSelector',
46 name: 'role',
47 value: 'NoAccess',
48 fieldLabel: gettext('Role'),
49 },
50 {
51 xtype: 'proxmoxcheckbox',
52 name: 'propagate',
53 checked: true,
54 uncheckedValue: 0,
55 fieldLabel: gettext('Propagate'),
56 },
57 ],
58 });