Merge pull request #16885 from gavindsouza/show-all-role-warning

fix(ux): Show note on how 'All' Role impacts users
This commit is contained in:
gavin 2022-05-12 18:05:56 +05:30 committed by GitHub
commit 04baffb1ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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() {