diff --git a/core/doctype/profile/profile.js b/core/doctype/profile/profile.js index 71de1169c8..d06c63574b 100644 --- a/core/doctype/profile/profile.js +++ b/core/doctype/profile/profile.js @@ -85,6 +85,15 @@ wn.RoleEditor = Class.extend({ show_roles: function() { var me = this; $(this.wrapper).empty(); + var add_all_roles = $('
').appendTo($(this.wrapper)); + add_all_roles.find("button").on("click", function() { + $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) { + if(!$(check).is(":checked")) { + check.checked = true; + } + }); + }); + for(var i in this.roles) { $(this.wrapper).append(repl('