From e6b5bf69a394ed1f10fa33fdac14f70ad3fe873e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 21 Oct 2020 09:42:56 +0200 Subject: [PATCH] gui: add permissions button to user view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- www/config/UserView.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/www/config/UserView.js b/www/config/UserView.js index 91e7a83a..eed96514 100644 --- a/www/config/UserView.js +++ b/www/config/UserView.js @@ -63,6 +63,19 @@ Ext.define('PBS.config.UserView', { }).show(); }, + showPermissions: function() { + let me = this; + let view = me.getView(); + let selection = view.getSelection(); + + if (selection.length < 1) return; + + Ext.create('Proxmox.PermissionView', { + auth_id: selection[0].data.userid, + auth_id_name: 'auth_id', + }).show(); + }, + renderUsername: function(userid) { return Ext.String.htmlEncode(userid.match(/^(.+)@([^@]+)$/)[1]); }, @@ -122,6 +135,12 @@ Ext.define('PBS.config.UserView', { enableFn: (rec) => rec.data.userid !== 'root@pam', callback: 'reload', }, + { + xtype: 'proxmoxButton', + text: gettext('Permissions'), + handler: 'showPermissions', + disabled: true, + }, ], viewConfig: {