IDEMPIERE-1362 Implement support to register/unregister available dashboard content. Fixed access to dashboard gadget not filter by user and role.

This commit is contained in:
Heng Sin Low 2013-09-17 21:34:48 +08:00
parent 28a6b8f811
commit 8cc6b3b69d
1 changed files with 18 additions and 1 deletions

View File

@ -247,7 +247,18 @@ public class WGadgets extends Window implements EventListener<Event>{
+" AND pre.AD_Role_ID = ?"
+" AND pre.AD_User_ID = ?"
+" AND pre.AD_Org_ID=0 "
+" AND pre.IsActive='Y') ";
+" AND pre.IsActive='Y') "
+" AND ("
+" ct.PA_DashboardContent_ID NOT IN ( SELECT PA_DashboardContent_ID "
+" FROM PA_DashboardContent_Access"
+" WHERE IsActive='Y' AND AD_Client_ID IN (0, ?))"
+" OR ct.PA_DashboardContent_ID IN ( SELECT cta.PA_DashboardContent_ID "
+" FROM PA_DashboardContent_Access cta "
+" WHERE cta.IsActive='Y'"
+" AND coalesce(cta.AD_Role_ID, ?) = ?"
+" AND coalesce(cta.AD_User_ID, ?) = ?"
+" AND cta.AD_Client_ID in (0,?) ) "
+" )";
ResultSet rs = null;
PreparedStatement pstmt = null;
@ -258,6 +269,12 @@ public class WGadgets extends Window implements EventListener<Event>{
pstmt.setInt(2, AD_CLient_ID);
pstmt.setInt(3, AD_Role_ID);
pstmt.setInt(4, AD_User_ID);
pstmt.setInt(5, AD_CLient_ID);
pstmt.setInt(6, AD_Role_ID);
pstmt.setInt(7, AD_Role_ID);
pstmt.setInt(8, AD_User_ID);
pstmt.setInt(9, AD_User_ID);
pstmt.setInt(10, AD_CLient_ID);
rs = pstmt.executeQuery();
while (rs.next()) {