fixed: hide links based on roles in accounts home

This commit is contained in:
Anand Doshi
2012-10-04 13:53:50 +05:30
parent 809226bcb7
commit 90a54a0435
3 changed files with 6 additions and 10 deletions

View File

@@ -128,7 +128,10 @@ erpnext.module_page.hide_links = function(wrapper) {
// pages
$(wrapper).find('[data-role]').each(function() {
if(!has_common(user_roles, [$(this).attr("data-role"), "System Manager"])) {
// can define multiple roles
var data_roles = $(this).attr("data-role").split(",").map(function(role) {
return role.trim(); });
if(!has_common(user_roles, ["System Manager"].concat(data_roles))) {
var html = $(this).html();
$(this).parent().css('color', '#999');
$(this).replaceWith('<span title="Only accessible by Roles: '+