IDEMPIERE-5258 Importing a print format in the same packin as the table throws errors (#1286)

IDEMPIERE-5258 #resolve
This commit is contained in:
Carlos Ruiz 2022-04-12 09:39:51 +02:00 committed by GitHub
parent ef929dfae5
commit 6fde4b816d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -68,7 +68,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport
/**
*
*/
private static final long serialVersionUID = -6317084960843429042L;
private static final long serialVersionUID = 7597852750014990009L;
/**
* Get Default (Client) Role
@ -1455,7 +1455,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport
return false;
} // isTableAccessLevel
/**
* Access to Column
* @param AD_Table_ID table
@ -1464,13 +1463,26 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport
* @return true if access
*/
public boolean isColumnAccess (int AD_Table_ID, int AD_Column_ID, boolean ro)
{
return isColumnAccess(AD_Table_ID, AD_Column_ID, ro, null);
}
/**
* Access to Column
* @param AD_Table_ID table
* @param AD_Column_ID column
* @param ro read only
* @param trxName
* @return true if access
*/
public boolean isColumnAccess (int AD_Table_ID, int AD_Column_ID, boolean ro, String trxName)
{
if (!isTableAccess(AD_Table_ID, ro)) // No Access to Table
return false;
loadColumnAccess(false);
// Verify access to process for buttons
MColumn column = MColumn.get(Env.getCtx(), AD_Column_ID);
MColumn column = MColumn.get(Env.getCtx(), AD_Column_ID, trxName);
if (column.getAD_Reference_ID() == DisplayType.Button && column.getAD_Process_ID() > 0) {
Boolean access = MRole.getDefault().getProcessAccess(column.getAD_Process_ID());
if (access == null)

View File

@ -255,7 +255,7 @@ public class MPrintFormat extends X_AD_PrintFormat implements ImmutablePOSupport
while (rs.next())
{
MPrintFormatItem pfi = new MPrintFormatItem(p_ctx, rs, get_TrxName());
if (role.isColumnAccess(getAD_Table_ID(), pfi.getAD_Column_ID(), true))
if (role.isColumnAccess(getAD_Table_ID(), pfi.getAD_Column_ID(), true, get_TrxName()))
list.add (pfi);
}
}