Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038758Openbravo ERPA. Platformpublic2018-06-14 13:112018-06-15 09:58
maite 
alostale 
immediatemajorrandom
closedfixed 
5
 
3.0PR18Q2.13.0PR18Q2.1 
AugustoMauch
Core
Production - QA Approved
2018-02-23
3.0PR18Q2
https://code.openbravo.com/erp/devel/pi/rev/2cd341c77062 [^]
No
0038758: having write access to a parent and one of its children orgs, sometimes it's not possible to read siblings of child one
Having an organization A, with at least 2 child nodes B and C and a role with write access to A and only one of its children (B or C):

   A
  / \
 B   C


When logging with that role, organization C should be readable but not writable.

But randomly organization C is not visible at all.
1. Login as Group Admin
2. In Role window select F&B España, S.A - Admin
   -> It defines write access to organizations España (A), España Norte (B) and España Sur (C)
3. In Org Access tab, select España Sur and mark it as not active
4. In User Assignment tab, grant this role to Openbravo user
5. Logout and login again with Openbravo user
6. Select F&B España, S.A - Admin role

7. Open Sales Order window
8. Remove filters
  -> ERROR (randomly):
         - got: orders only from Norte and España organizations are displayed
         - expected: also orders from Sur organization should be visible though not writable
No tags attached.
depends on defect 0038761 closed alostale having write access to a parent and one of its children orgs, sometimes it's not possible to read siblings of child one 
Issue History
2018-06-14 13:11maiteNew Issue
2018-06-14 13:11maiteAssigned To => platform
2018-06-14 13:11maiteModules => Core
2018-06-14 13:11maiteResolution time => 1530741600
2018-06-14 13:11maiteTriggers an Emergency Pack => No
2018-06-14 13:12maiteIssue Monitored: networkb
2018-06-14 16:19alostaleRegression level => Production - QA Approved
2018-06-14 16:19alostaleRegression date => 2018-02-23
2018-06-14 16:19alostaleRegression introduced in release => 3.0PR18Q2
2018-06-14 16:19alostaleRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/2cd341c77062 [^]
2018-06-14 16:19alostaleAssigned Toplatform => alostale
2018-06-14 16:22alostaleReview Assigned To => caristu
2018-06-14 16:22alostaleReproducibilityalways => random
2018-06-14 16:22alostaleDescription Updatedbug_revision_view_page.php?rev_id=17295#r17295
2018-06-14 16:26alostaleDescription Updatedbug_revision_view_page.php?rev_id=17296#r17296
2018-06-14 16:26alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17298#r17298
2018-06-14 16:26alostaleProposed Solution updated
2018-06-14 16:35alostaleSummary"setReadableOrganizations" produce different results, depending on the order organizations are considered => having write access to a parent and one of its children orgs, sometimes it's not possible to read siblings of child one
2018-06-14 16:35alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17299#r17299
2018-06-14 16:36alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17300#r17300
2018-06-14 16:36alostaleStatusnew => scheduled
2018-06-14 16:37alostaleDescription Updatedbug_revision_view_page.php?rev_id=17301#r17301
2018-06-14 16:38alostaleDescription Updatedbug_revision_view_page.php?rev_id=17302#r17302
2018-06-14 17:02alostaleRelationship addedcaused by 0037980
2018-06-15 08:10alostaleReview Assigned Tocaristu => AugustoMauch
2018-06-15 08:10alostaleTypedefect => backport
2018-06-15 08:10alostaleTarget Version => 3.0PR18Q2.1
2018-06-15 08:10alostaleRelationship deletedcaused by 0037980
2018-06-15 08:12hgbotCheckin
2018-06-15 08:12hgbotNote Added: 0105158
2018-06-15 08:12hgbotStatusscheduled => resolved
2018-06-15 08:12hgbotResolutionopen => fixed
2018-06-15 08:12hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR18Q2.1/rev/9f8b56a41406e7c136f6f8096fdf98b9c12aa546 [^]
2018-06-15 09:58AugustoMauchNote Added: 0105165
2018-06-15 09:58AugustoMauchStatusresolved => closed
2018-06-15 09:58AugustoMauchFixed in Version => 3.0PR18Q2.1

Notes
(0105158)
hgbot   
2018-06-15 08:12   
Repository: erp/backports/3.0PR18Q2.1
Changeset: 9f8b56a41406e7c136f6f8096fdf98b9c12aa546
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Jun 14 17:08:07 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q2.1/rev/9f8b56a41406e7c136f6f8096fdf98b9c12aa546 [^]

fixed bug 38758: with write access to an org and one child, can't read siblings

  Having an organization A, with at least 2 child nodes B and C and a role with
  write access to A and only one of its children B, randomly cannot read info in
  C.

  Readable organizations should be all the ones that are part of the natural tree
  of each of the writable organizations. When calculating them there was a wrong
  optimization that assumed if an organization was already calculated to be part
  of the readable orgs, its natural tree would also be so there was no need to
  recalculate it.

  This is not true if it was included becuase it is part of natural tree of one
  of its writable descendants, in this case if this org is also writable its natural
  tree needs to be calculated.

  As calculating natural tree on memory is not that expensive it is not worth to
  include more complex logic to decide whether it requires to be calculated or not:
  now it will be calculated for all writable organizations.

---
M src/org/openbravo/dal/core/OBContext.java
---
(0105165)
AugustoMauch   
2018-06-15 09:58   
Code reviewed and verified in [1]@9f8b56a41406

[1] https://code.openbravo.com/erp/backports/3.0PR18Q2.1 [^]