[refactor] Client-side permission handling

This commit is contained in:
Anand Doshi
2013-12-19 19:11:30 +05:30
parent 2298d59b8b
commit 8a436500f0
9 changed files with 9 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root customer group
if(!doc.parent_customer_group) {
cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root customer group and cannot be edited."));
} else {
cur_frm.set_intro(null);

View File

@@ -18,7 +18,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root item group
if(!doc.parent_item_group) {
cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root item group and cannot be edited."));
} else {
cur_frm.set_intro(null);

View File

@@ -8,7 +8,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root
if(!doc.parent_sales_person) {
cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root sales person and cannot be edited."));
} else {
cur_frm.set_intro(null);

View File

@@ -8,7 +8,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.cscript.set_root_readonly = function(doc) {
// read-only for root territory
if(!doc.parent_territory) {
cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root territory and cannot be edited."));
} else {
cur_frm.set_intro(null);