Openbravo Issue Tracking System - Retail Modules
View Issue Details
0034764Retail ModulesStoreServerpublic2016-12-17 18:372016-12-28 09:54
mtaal 
mtaal 
normalminorhave not tried
closedfixed 
5
 
RR17Q1RR17Q1 
Sandrahuguet
No
No
0034764: StoreServer support hasPermission also for stateless mobile services
When a mobile service has the annotation
@AuthenticationManager.Stateless

then the mobile service needs to override the hasPermission method as this method creates a session. If the method is not overridden then a warning is logged [1]. A better solution is to prevent the http session creation in the method [2].

[1]
1867120 [http-bio-9080-exec-3] WARN org.openbravo.mobile.core.process.SecuredJSONProcess - Allowing permission by default for a stateless request, override the hasPermission method to prevent this warning
1927118 [http-bio-9080-exec-4] WARN org.openbravo.mobile.core.process.SecuredJSONProcess - Allowing permission by default for a stateless request, override the hasPermission method to prevent this warning
1987107 [http-bio-9080-exec-8] WARN org.openbravo.mobile.core.process.SecuredJSONProcess - Allowing permission by default for a stateless request, override the hasPermission method to prevent this warning

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/b08a151d8926/src/org/openbravo/mobile/core/process/SecuredJSONProcess.java#l102 [^]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/b08a151d8926/src/org/openbravo/mobile/core/process/SecuredJSONProcess.java#l111 [^]
Run multi-server with the server state background process every minute

Then the above log message is created every few minutes.
No tags attached.
Issue History
2016-12-17 18:37mtaalNew Issue
2016-12-17 18:37mtaalAssigned To => mtaal
2016-12-17 18:37mtaalOBNetwork customer => No
2016-12-17 18:37mtaalTriggers an Emergency Pack => No
2016-12-17 23:33hgbotCheckin
2016-12-17 23:33hgbotNote Added: 0092732
2016-12-18 09:33hgbotCheckin
2016-12-18 09:33hgbotNote Added: 0092733
2016-12-18 21:58hgbotCheckin
2016-12-18 21:58hgbotNote Added: 0092736
2016-12-18 21:58hgbotStatusnew => resolved
2016-12-18 21:58hgbotResolutionopen => fixed
2016-12-18 21:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/af1f73ae2a771fb319d84dc145ea71d10330cebb [^]
2016-12-23 13:22mtaalReview Assigned To => Sandrahuguet
2016-12-28 09:54SandrahuguetNote Added: 0093035
2016-12-28 09:54SandrahuguetStatusresolved => closed
2016-12-28 09:54SandrahuguetFixed in Version => RR17Q1

Notes
(0092732)
hgbot   
2016-12-17 23:33   
Repository: erp/pmods/org.openbravo.retail.postest
Changeset: dcd481d8a2bad54d457b7a28f7bc5164aa72e89d
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Dec 17 23:33:11 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.postest/rev/dcd481d8a2bad54d457b7a28f7bc5164aa72e89d [^]

Related to issue 34764: StoreServer support hasPermission also for stateless mobile services
Change testcase to do hasPermission

---
M src/org/openbravo/retail/postest/POSTestStatelessMobileService.java
---
(0092733)
hgbot   
2016-12-18 09:33   
Repository: erp/pmods/org.openbravo.retail.postest
Changeset: 2b474790d55553ec8b0d477d7f7fd6a1cef2706e
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Dec 18 09:32:40 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.postest/rev/2b474790d55553ec8b0d477d7f7fd6a1cef2706e [^]

Related to issue 34764: StoreServer support hasPermission also for stateless mobile services
Override the checkpermission to not let the test be blocked by lack of permission
in test sample data, but still call super.checkPermission to do the check

---
M src/org/openbravo/retail/postest/POSTestStatelessMobileService.java
---
(0092736)
hgbot   
2016-12-18 21:58   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: af1f73ae2a771fb319d84dc145ea71d10330cebb
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Dec 18 21:58:26 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/af1f73ae2a771fb319d84dc145ea71d10330cebb [^]

Fixes issue 34764: StoreServer support hasPermission also for stateless mobile services
Make sure that hasPermission does not create a session

---
M src/org/openbravo/mobile/core/process/SecuredJSONProcess.java
---
(0093035)
Sandrahuguet   
2016-12-28 09:54   
reviewed and tested