details:   https://code.openbravo.com/erp/devel/pi/rev/50ec19da3e97
changeset: 33002:50ec19da3e97
user:      Inigo Sanchez <inigo.sanchez <at> openbravo.com>
date:      Tue Nov 14 14:15:07 2017 +0100
summary:   Fixed issue 37278: Deactivated roles are displayed in the user 
profile widget

The problem was caused by the "Improve scalability of the login process" 
project. When improving the performance
of the query that return the complete role list for the current user, the 
OBQuery instance used to generate it was
replaced with a Query instance. The first includes by default the filter by is 
active.

To fix the problem this filter must be added manually in the query. Now the 
problem has been resolved by take into
account this filter.

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoComponent.java
 |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r e93ad7f316fc -r 50ec19da3e97 
modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoComponent.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoComponent.java
      Tue Nov 14 14:13:19 2017 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoComponent.java
      Tue Nov 14 14:15:07 2017 +0100
@@ -134,7 +134,7 @@
     // return the complete role list for the current user
     final StringBuilder hql = new StringBuilder();
     hql.append("select ur.role.id, ur.role.name, ur.client.id, ur.client.name 
from ADUserRoles ur ");
-    hql.append("where ur.userContact.id=:userId and ur.role.active=true and 
ur.role.isrestrictbackend=false ");
+    hql.append("where ur.active=true and ur.userContact.id=:userId and 
ur.role.active=true and ur.role.isrestrictbackend=false ");
     Query rolesQry = 
OBDal.getInstance().getSession().createQuery(hql.toString());
     rolesQry.setString("userId", OBContext.getOBContext().getUser().getId());
     for (Object entry : rolesQry.list()) {

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to