Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028586Openbravo ERPA. Platformpublic2015-01-13 15:342017-06-01 14:53
alostale 
alostale 
urgentminorhave not tried
closedfixed 
5
 
3.0PR16Q33.0PR16Q3 
caristu
Core
No
0028586: SimpleProduct selector shows errors in log when there are translations installed
When there is at least a translation installed, using SimpleProduct selector logs errors if the role has no derived read access to uOMTrl entity.

Even the error appears the selector works fine, but it always shows the base name for the uom (if it is present) instead of the translated one.
-Install Spanish translation
-Create a manual role with access only to Sales Invoice window
-Login with that role
-Go to Sales Invoice window
-Create a new header
-Create a new Line and open product drop down
  --> This error appears in log

8737052 [http-8080-10] ERROR org.openbravo.base.exception.OBSecurityException - Entity UOMTrl is not readable by the user 100
org.openbravo.base.exception.OBSecurityException: Entity UOMTrl is not readable by the user 100
    at org.openbravo.dal.security.EntityAccessChecker.checkReadable(EntityAccessChecker.java:346)
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:596)
    at org.openbravo.dal.service.OBDal.createCriteria(OBDal.java:458)
    at org.openbravo.base.structure.BaseOBObject.getDataValue(BaseOBObject.java:144)
    at org.openbravo.base.structure.BaseOBObject.get(BaseOBObject.java:253)
    at org.openbravo.base.structure.IdentifierProvider.getIdentifier(IdentifierProvider.java:133)
    at org.openbravo.base.structure.IdentifierProvider.getIdentifier(IdentifierProvider.java:78)
    at org.openbravo.base.structure.BaseOBObject.getIdentifier(BaseOBObject.java:195)
    at org.openbravo.service.json.DataToJsonConverter.addBaseOBObject(DataToJsonConverter.java:355)
When DAL grants derived access to an entity, it should also grant it for its translation entity if exists.
No tags attached.
blocks design defect 0036162 acknowledged Triage Platform Base clean up openbravo.log 
Issue History
2015-01-13 15:34alostaleNew Issue
2015-01-13 15:34alostaleAssigned To => AugustoMauch
2015-01-13 15:34alostaleModules => Core
2015-01-13 15:34alostaleTriggers an Emergency Pack => No
2015-03-11 10:07alostaleStatusnew => acknowledged
2015-03-17 14:38alostaleAssigned ToAugustoMauch => platform
2015-06-09 15:32alostalePrioritynormal => urgent
2015-07-03 11:43alostaleTarget Version => 3.0PR15Q4
2015-07-03 11:45alostaleStatusacknowledged => scheduled
2015-07-03 11:45alostaleAssigned Toplatform => NaroaIriarte
2015-07-03 11:52shuehnerNote Added: 0078637
2015-07-15 17:25NaroaIriarteNote Added: 0078827
2015-07-15 17:25NaroaIriarteTypedefect => design defect
2015-10-01 07:52alostaleTarget Version3.0PR15Q4 =>
2015-11-11 15:05NaroaIriarteAssigned ToNaroaIriarte => platform
2015-11-11 16:11alostaleStatusscheduled => acknowledged
2015-11-13 14:10shuehnerNote Added: 0081824
2016-03-30 11:44alostaleTypedesign defect => defect
2016-03-30 11:44alostaleTarget Version => 3.0PR16Q3
2016-03-30 11:44alostaleStatusacknowledged => scheduled
2016-04-01 14:46hgbotCheckin
2016-04-01 14:46hgbotNote Added: 0085396
2016-04-01 14:46hgbotStatusscheduled => resolved
2016-04-01 14:46hgbotResolutionopen => fixed
2016-04-01 14:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/840a1ebd69c8922e2f73de1df9884adc4ed6609a [^]
2016-04-01 14:46alostaleAssigned Toplatform => alostale
2016-04-01 14:46alostaleReview Assigned To => caristu
2016-04-08 10:19caristuNote Added: 0085510
2016-04-08 10:19caristuStatusresolved => closed
2016-04-08 10:19caristuFixed in Version => 3.0PR16Q3
2016-06-17 19:36hudsonbotCheckin
2016-06-17 19:36hudsonbotNote Added: 0087412
2017-06-01 14:53alostaleRelationship addedblocks 0036162

Notes
(0078637)
shuehner   
2015-07-03 11:52   
Commenting in many (maybe all) just before there is 2nd stacktrace probably triggered by the same topic:

ERROR org.openbravo.base.exception.OBSecurityException - Entity UOM is not directly readable, only id and identifier properties are readable,
property UOM.uOMTrlList is neither of these.
org.openbravo.base.exception.OBSecurityException: Entity UOM is not directly readable, only id and identifier properties are readable, property UOM.uOMTrlList is neither of these.
        at org.openbravo.base.structure.BaseOBObject.checkDerivedReadable(BaseOBObject.java:289)
        at org.openbravo.base.structure.BaseOBObject.get(BaseOBObject.java:251)
        at org.openbravo.base.structure.BaseOBObject.get(BaseOBObject.java:228)
        at org.openbravo.base.structure.BaseOBObject.get(BaseOBObject.java:209)
        at org.openbravo.base.structure.BaseOBObject.getDataValue(BaseOBObject.java:129)
        at org.openbravo.base.structure.BaseOBObject.get(BaseOBObject.java:253)
        at org.openbravo.base.structure.IdentifierProvider.getIdentifier(IdentifierProvider.java:133)
        at org.openbravo.base.structure.IdentifierProvider.getIdentifier(IdentifierProvider.java:78)
        at org.openbravo.base.structure.BaseOBObject.getIdentifier(BaseOBObject.java:195)
        at org.openbravo.service.json.DataToJsonConverter.addBaseOBObject(DataToJsonConverter.java:354)
        at org.openbravo.service.json.DataToJsonConverter.convertToJsonObjects(DataToJsonConverter.java:110)
        at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetchJSONObject(ReadOnlyDataSourceService.java:142)
        at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetch(ReadOnlyDataSourceService.java:70)
        at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet.java:268)
        at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:754)
(0078827)
NaroaIriarte   
2015-07-15 17:25   
The problem is in the custom query of the SimpleProduct selector, there it is trying to access to UOM and that is why this error is got.
The thing is to be able to somehow specify the entities that we want to access.
(0081824)
shuehner   
2015-11-13 14:10   
I think we should think on permission system here if something like the following makes sense.
If you have that 'id+identifier' are readable for some base object like UOM.

If that should also automatically allow the following.
- Access to id+identifier of the UOMTrl
- access to 'get to it' i.e. UOM.uOMTrlList
- Note: for 'current language' or 'all languages'
(0085396)
hgbot   
2016-04-01 14:46   
Repository: erp/devel/pi
Changeset: 840a1ebd69c8922e2f73de1df9884adc4ed6609a
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Apr 01 14:45:21 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/840a1ebd69c8922e2f73de1df9884adc4ed6609a [^]

fixed bug 28586: error logged showing translatable identifier

  Having at least one translation installed in the system, whenever a DAL
  identifier composed by translatable properties when retrieved, an error was
  logged in case the translation entity for that property was not granted to
  current role.

  This is fixed by executing the query to retrieve translation in admin mode.

  If the base property is granted at least in referred mode, its translations
  should be accessible, so it is not problematic to set admin.

---
M src/org/openbravo/base/structure/BaseOBObject.java
---
(0085510)
caristu   
2016-04-08 10:19   
Code review + testing OK
(0087412)
hudsonbot   
2016-06-17 19:36   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/0dc7be081b1c [^]
Maturity status: Test