[pbs-devel] [PATCH proxmox-backup 13/16] gui: add permissions button to user view

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Oct 28 12:37:14 CET 2020


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---

Notes:
    requires proxmox-widget-toolkit with PermissionView

 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 at pam',
 	    callback: 'reload',
 	},
+	{
+	    xtype: 'proxmoxButton',
+	    text: gettext('Permissions'),
+	    handler: 'showPermissions',
+	    disabled: true,
+	},
     ],
 
     viewConfig: {
-- 
2.20.1






More information about the pbs-devel mailing list