From 8a2c351cf1b6856168fe1e3bc6c60dd99fddc82b Mon Sep 17 00:00:00 2001 From: gavin Date: Thu, 12 May 2022 13:29:57 +0530 Subject: [PATCH] fix(ux): Show note on how 'All' Role impacts users In response to https://github.com/frappe/frappe/issues/16836 --- frappe/core/doctype/role/role.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/role/role.js b/frappe/core/doctype/role/role.js index f436c8c166..595e857d02 100644 --- a/frappe/core/doctype/role/role.js +++ b/frappe/core/doctype/role/role.js @@ -1,8 +1,15 @@ -// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors -// MIT License. See license.txt +// Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors +// MIT License. See LICENSE frappe.ui.form.on('Role', { refresh: function(frm) { + if (frm.doc.name === "All") { + frm.dashboard.add_comment( + __("Role 'All' will be given to all System Users."), + "yellow" + ); + } + frm.set_df_property('is_custom', 'read_only', frappe.session.user !== 'Administrator'); frm.add_custom_button("Role Permissions Manager", function() {