[pve-devel] [PATCH manager] gui: do not allow to edit 'special' roles
Dominik Csapak
d.csapak at proxmox.com
Fri Jan 31 11:48:02 CET 2020
since any change to them is currently silently ignored by the backend
and should result in an error anyway
partially fixes #2575
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
www/manager6/dc/RoleView.js | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/www/manager6/dc/RoleView.js b/www/manager6/dc/RoleView.js
index ee8571ba..e21e2920 100644
--- a/www/manager6/dc/RoleView.js
+++ b/www/manager6/dc/RoleView.js
@@ -45,7 +45,7 @@ Ext.define('PVE.dc.RoleView', {
return;
}
- if (rec.data.special === "1") {
+ if (!!rec.data.special) {
return;
}
@@ -108,9 +108,7 @@ Ext.define('PVE.dc.RoleView', {
disabled: true,
selModel: sm,
handler: run_editor,
- enableFn: function(record) {
- return record.data.special !== '1';
- }
+ enableFn: (rec) => !rec.data.special,
},
{
xtype: 'proxmoxStdRemoveButton',
@@ -119,9 +117,7 @@ Ext.define('PVE.dc.RoleView', {
reload();
},
baseurl: '/access/roles/',
- enableFn: function(record) {
- return record.data.special !== '1';
- }
+ enableFn: (rec) => !rec.data.special,
}
]
});
--
2.20.1
More information about the pve-devel
mailing list