]>
git.proxmox.com Git - proxmox-backup.git/blob - www/config/ACLView.js
1 Ext
.define('pmx-acls', {
2 extend
: 'Ext.data.Model',
4 'path', 'ugid', 'ugid_type', 'roleid', 'propagate',
7 calculate: function(data
) {
8 return `${data.path} for ${data.ugid} - ${data.roleid}`;
15 url
: '/api2/json/access/acl',
19 Ext
.define('PBS.config.ACLView', {
20 extend
: 'Ext.grid.GridPanel',
21 alias
: 'widget.pbsACLView',
26 title
: gettext('Permissions'),
32 xclass
: 'Ext.app.ViewController',
34 addUserACL: function() {
36 let view
= me
.getView();
37 Ext
.create('PBS.window.ACLEdit', {
48 addTokenACL: function() {
50 let view
= me
.getView();
51 Ext
.create('PBS.window.ACLEdit', {
63 removeACL: function(btn
, event
, rec
) {
65 Proxmox
.Utils
.API2Request({
71 role
: rec
.data
.roleid
,
72 auth_id
: rec
.data
.ugid
,
74 callback: function() {
77 failure: function(response
, opts
) {
78 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
83 reload: function() { this.getView().getStore().rstore
.load(); },
85 init: function(view
) {
86 let proxy
= view
.getStore().rstore
.getProxy();
89 if (view
.aclPath
!== undefined) {
90 params
.path
= view
.aclPath
;
92 if (view
.aclExact
!== undefined) {
93 params
.exact
= view
.aclExact
;
95 proxy
.setExtraParams(params
);
96 Proxmox
.Utils
.monStoreErrors(view
, view
.getStore().rstore
);
100 activate: function() {
101 this.getView().getStore().rstore
.startUpdate();
103 deactivate: function() {
104 this.getView().getStore().rstore
.stopUpdate();
113 autoDestroyRstore
: true,
125 text
: gettext('Add'),
130 text
: gettext('User Permission'),
131 iconCls
: 'fa fa-fw fa-user',
132 handler
: 'addUserACL',
135 text
: gettext('API Token Permission'),
136 iconCls
: 'fa fa-fw fa-user-o',
137 handler
: 'addTokenACL',
143 xtype
: 'proxmoxStdRemoveButton',
144 handler
: 'removeACL',
151 header
: gettext('Path'),
154 renderer
: Ext
.String
.htmlEncode
,
158 header
: gettext('User/Group/API Token'),
161 renderer
: Ext
.String
.htmlEncode
,
165 header
: gettext('Role'),
171 header
: gettext('Propagate'),
174 renderer
: Proxmox
.Utils
.format_boolean
,
175 dataIndex
: 'propagate',