[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

@ -37,7 +37,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
// read-only for root accounts
if(!doc.parent_account) {
cur_frm.perm = [[1,0,0], [1,0,0]];
cur_frm.set_read_only();
cur_frm.set_intro(wn._("This is a root account and cannot be edited."));
} else {
// credit days and type if customer or supplier

View File

@ -254,15 +254,15 @@ patch_list = [
"patches.1311.p04_update_comments",
"patches.1311.p05_website_brand_html",
"patches.1311.p06_fix_report_columns",
"patches.1311.p06_update_user_properties",
"execute:webnotes.delete_doc('DocType', 'Documentation Tool')",
"execute:webnotes.delete_doc('Report', 'Stock Ledger') #2013-11-29",
"patches.1312.p01_delete_old_stock_reports",
"execute:webnotes.delete_doc('Report', 'Payment Collection With Ageing')",
"execute:webnotes.delete_doc('Report', 'Payment Made With Ageing')",
"patches.1311.p07_scheduler_errors_digest",
"patches.1311.p08_email_digest_recipients",
"execute:webnotes.delete_doc('DocType', 'Warehouse Type')",
"patches.1311.p07_move_warehouse_user_to_restrictions",
"patches.1311.p08_new_permissions",
"patches.1312.p01_delete_old_stock_reports",
"patches.1312.p02_update_user_properties",
"patches.1312.p03_move_warehouse_user_to_restrictions",
"patches.1312.p04_new_permissions",
]

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);