From 27551c87c94e11ee10c32a7cba3de2f12a12091a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 21 Aug 2013 09:52:49 -0500 Subject: [PATCH] IDEMPIERE-1160 Hide potentially dangerous stuff from non-admin users / fix script --- db/ddlutils/postgresql/views/AD_FIELD_V.sql | 16 ++++----- db/ddlutils/postgresql/views/AD_FIELD_VT.sql | 18 +++++----- .../20130801160000_IDEMPIERE-1160.sql | 36 ++++++++++--------- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/db/ddlutils/postgresql/views/AD_FIELD_V.sql b/db/ddlutils/postgresql/views/AD_FIELD_V.sql index 1978fc8eaf..e374d118f6 100644 --- a/db/ddlutils/postgresql/views/AD_FIELD_V.sql +++ b/db/ddlutils/postgresql/views/AD_FIELD_V.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE VIEW adempiere.ad_field_v AS +CREATE OR REPLACE VIEW ad_field_v AS SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, @@ -17,10 +17,10 @@ CREATE OR REPLACE VIEW adempiere.ad_field_v AS COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield - FROM adempiere.ad_field f - JOIN adempiere.ad_tab t ON f.ad_tab_id = t.ad_tab_id - LEFT JOIN adempiere.ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id - LEFT JOIN adempiere.ad_column c ON f.ad_column_id = c.ad_column_id - JOIN adempiere.ad_table tbl ON c.ad_table_id = tbl.ad_table_id - LEFT JOIN adempiere.ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) - WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar; \ No newline at end of file + FROM ad_field f + JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id + LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id + LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id + JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id + LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) + WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar; diff --git a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql index 284b997c8f..160025eeaa 100644 --- a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql +++ b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE VIEW adempiere.ad_field_vt AS +CREATE OR REPLACE VIEW ad_field_vt AS SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, @@ -18,12 +18,12 @@ COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautoco COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield - FROM adempiere.ad_field f - JOIN adempiere.ad_field_trl trl ON f.ad_field_id = trl.ad_field_id - JOIN adempiere.ad_tab t ON f.ad_tab_id = t.ad_tab_id - LEFT JOIN adempiere.ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id - LEFT JOIN adempiere.ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text - LEFT JOIN adempiere.ad_column c ON f.ad_column_id = c.ad_column_id - JOIN adempiere.ad_table tbl ON c.ad_table_id = tbl.ad_table_id - LEFT JOIN adempiere.ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) + FROM ad_field f + JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id + JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id + LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id + LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text + LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id + JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id + LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar; diff --git a/migration/i1.0c-release/postgresql/20130801160000_IDEMPIERE-1160.sql b/migration/i1.0c-release/postgresql/20130801160000_IDEMPIERE-1160.sql index 2b195b9733..1a4aeb820c 100644 --- a/migration/i1.0c-release/postgresql/20130801160000_IDEMPIERE-1160.sql +++ b/migration/i1.0c-release/postgresql/20130801160000_IDEMPIERE-1160.sql @@ -247,7 +247,9 @@ UPDATE AD_Field SET SeqNo=390,Updated=TO_TIMESTAMP('2013-08-06 14:45:24','YYYY-M update ad_tab set isadvancedtab='N' where isadvancedtab='Y' ; -CREATE OR REPLACE VIEW adempiere.ad_field_v AS +DROP VIEW ad_field_v; + +CREATE OR REPLACE VIEW ad_field_v AS SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, @@ -266,16 +268,18 @@ CREATE OR REPLACE VIEW adempiere.ad_field_v AS COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield - FROM adempiere.ad_field f - JOIN adempiere.ad_tab t ON f.ad_tab_id = t.ad_tab_id - LEFT JOIN adempiere.ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id - LEFT JOIN adempiere.ad_column c ON f.ad_column_id = c.ad_column_id - JOIN adempiere.ad_table tbl ON c.ad_table_id = tbl.ad_table_id - LEFT JOIN adempiere.ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) + FROM ad_field f + JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id + LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id + LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id + JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id + LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar ; -CREATE OR REPLACE VIEW adempiere.ad_field_vt AS +DROP VIEW ad_field_vt; + +CREATE OR REPLACE VIEW ad_field_vt AS SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, @@ -295,14 +299,14 @@ COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautoco COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton, c.formatpattern, f.isadvancedfield - FROM adempiere.ad_field f - JOIN adempiere.ad_field_trl trl ON f.ad_field_id = trl.ad_field_id - JOIN adempiere.ad_tab t ON f.ad_tab_id = t.ad_tab_id - LEFT JOIN adempiere.ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id - LEFT JOIN adempiere.ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text - LEFT JOIN adempiere.ad_column c ON f.ad_column_id = c.ad_column_id - JOIN adempiere.ad_table tbl ON c.ad_table_id = tbl.ad_table_id - LEFT JOIN adempiere.ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) + FROM ad_field f + JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id + JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id + LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id + LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text + LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id + JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id + LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar ;