details: https://code.openbravo.com/erp/devel/pi/rev/f7c2d3f60821 changeset: 28867:f7c2d3f60821 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Fri Apr 08 14:58:03 2016 +0200 summary: fixes issue 32627: template role cannot be used as session role Now the injector used for preferences returns the complete Role object and not a proxy, in order to prevent possible LazyInitializationException when using a template role as session role. This was happening because some preferences are created at system level when a session role is making use of the UI. It is also verified that after fixing this issue, those preferences are not being propagated, thanks to the preference black list.
diffstat: src/org/openbravo/role/inheritance/access/PreferenceAccessInjector.java | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diffs (24 lines): diff -r 5068c169fe15 -r f7c2d3f60821 src/org/openbravo/role/inheritance/access/PreferenceAccessInjector.java --- a/src/org/openbravo/role/inheritance/access/PreferenceAccessInjector.java Fri Apr 08 14:07:14 2016 +0200 +++ b/src/org/openbravo/role/inheritance/access/PreferenceAccessInjector.java Fri Apr 08 14:58:03 2016 +0200 @@ -25,6 +25,7 @@ import org.openbravo.base.structure.BaseOBObject; import org.openbravo.base.structure.InheritedAccessEnabled; import org.openbravo.dal.core.DalUtil; +import org.openbravo.dal.service.OBDal; import org.openbravo.dal.service.OBQuery; import org.openbravo.erpCommon.businessUtility.Preferences; import org.openbravo.erpCommon.utility.Utility; @@ -72,7 +73,11 @@ public Role getRole(InheritedAccessEnabled access) { // Preference does not have role property as parent Preference preference = (Preference) access; - return preference.getVisibleAtRole(); + if (preference.getVisibleAtRole() == null) { + return null; + } + String roleId = (String) DalUtil.getId(preference.getVisibleAtRole()); + return (Role) OBDal.getInstance().get(Role.class, roleId); } @Override ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532 _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits