mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 14:38:26 +00:00
[refactor] Client-side permission handling
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user