details:   https://code.openbravo.com/erp/devel/pi/rev/b638e581f3c3
changeset: 35715:b638e581f3c3
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Mon May 06 15:49:37 2019 +0200
summary:   fixed issue 40787: roles require back-office access to log in to 
mobile apps

  MobileLoginHandler does a back-office login to later select mobile default 
role,
  it expects back-office to fail and keep session in case of restricted role 
login
  attempt.

  Back-office login handler was changed to fail and remove session in case 
there is
  no back-office role in current user's list. This made not possible to log in 
to
  mobile apps.

  Now if logging in to a mobile application session is kept after failure as it 
was
  before.

diffstat:

 src/org/openbravo/base/secureApp/LoginHandler.java |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 3f7bc51bb14f -r b638e581f3c3 
src/org/openbravo/base/secureApp/LoginHandler.java
--- a/src/org/openbravo/base/secureApp/LoginHandler.java        Mon May 06 
12:12:55 2019 +0200
+++ b/src/org/openbravo/base/secureApp/LoginHandler.java        Mon May 06 
15:49:37 2019 +0200
@@ -324,7 +324,6 @@
         goToRetry(res, vars, msg, title, "Error", action);
         return;
       }
-
       // Build checks
 
       if (sysInfo.getSystemStatus() == null || 
sysInfo.getSystemStatus().equals("RB70")
@@ -411,6 +410,11 @@
 
   }
 
+  /** Is current login for a back-office session */
+  protected boolean isBackOfficeLogin() {
+    return true;
+  }
+
   private String getUserStartPage(String userId, RoleDefaults rd, String 
target,
       String targetQueryString) {
     String startPage = null;
@@ -525,7 +529,8 @@
       jsonMsg.put("messageTitle", title);
       jsonMsg.put("messageText", msg);
 
-      if (loginHasError) {
+      if (loginHasError && isBackOfficeLogin()) {
+        // mobile apps expect session to be populated in case of backoffice 
restricted roles
         vars.clearSession(false);
       }
 


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to