Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0050160
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2022-09-05 15:552022-09-29 11:33
ReporterXABIER_AGUADOView Statuspublic 
Assigned Tocaristu 
PrioritynormalResolutionfixedFixed in VersionPR22Q4
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0050160: Write access should not be done when flushing dirty changes of bobs saved in admin mode

DescriptionWhen saving a new BaseOBObject or flushing changes done in BaseOBObjecs, a check for a write access is done in the OBInterceptor.

This causes that BaseOBObjects created correcly in admin mode, are not finally persisted in the database because the OBInterceptor may perform the write checks on dirty changes not in admin mode.

That check should be skipped BaseOBObjects saved in admin mode.
Steps To Reproduce1) Create a new BaseOBObject in admin mode for an entity not writable for the current context user. Save it with OBDal.getInstance.save(bob) -> This works fine because we are inside an admin mode block.
2) Do an update in that BaseOBObject (this generates a dirty change) and execute OBDal.getInstance.flush() outside of the admin mode block. ERROR: The flush operation fails because the write access check is not passed.
TagsFASH
Attached Filestxt file icon log.txt [^] (5,871 bytes) 2022-09-05 15:55 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0048579 closedcaristu Push API 
related to defect 0053767 newTriage Platform Base During a synchronization data process it is not posible to update a column without a flush execution 

-  Notes
(0140838)
hgbot (developer)
2022-09-08 09:33

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/705 [^]
(0141403)
hgbot (developer)
2022-09-27 13:52

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: a0abd477c5478133fb582a4658a29bd1a57ad6dd
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 27-09-2022 11:50:57
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/a0abd477c5478133fb582a4658a29bd1a57ad6dd [^]

fixes BUG-50160: Skip write access check when flushing BOBs saved in admin mode

  Skip the write access check which is done after editing a BOB
previously saved being in admin mode. Under this scenario, the
OBInterceptor is invoked due to having dirty changes pending to be
flushed.

  With this fix we keep track if the write and org/client access checks
were enabled when a BaseOBObject is saved and use this information when
the object is eventually flushed.

  We have three possible scenarios:

  1) The object is not saved in admin mode: both access checks will be
done for the BOB when it is flushed
  2) The object is saved in admin mode, having called
setAdminMode(false): both access checks will be skipped for the BOB when
it is flushed
  3) The object is saved in admin mode, having called
setAdminMode(true): only the org/client access check is done for the
BOB when it is flushed

---
M src-test/src/org/openbravo/test/dal/AdminContextTest.java
M src/org/openbravo/base/structure/BaseOBObject.java
M src/org/openbravo/dal/security/SecurityChecker.java
M src/org/openbravo/dal/service/OBDal.java
---
(0141404)
hgbot (developer)
2022-09-27 13:52

Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/705 [^]

- Issue History
Date Modified Username Field Change
2022-09-05 15:55 XABIER_AGUADO New Issue
2022-09-05 15:55 XABIER_AGUADO Assigned To => Triage Platform Conn
2022-09-05 15:55 XABIER_AGUADO File Added: log.txt
2022-09-05 15:55 XABIER_AGUADO Triggers an Emergency Pack => No
2022-09-05 15:55 XABIER_AGUADO Description Updated View Revisions
2022-09-05 16:04 XABIER_AGUADO Tag Attached: FASH
2022-09-08 09:33 hgbot Note Added: 0140838
2022-09-09 12:41 caristu Summary Some Roles end up having Infinite Loading Screens when trying to do DOIs => Write access should not be done when flushing bobs created/edited in admin mode
2022-09-09 12:41 caristu Description Updated View Revisions
2022-09-09 12:41 caristu Steps to Reproduce Updated View Revisions
2022-09-09 12:41 caristu Project Retail Modules => Openbravo ERP
2022-09-09 12:41 caristu Modules => Core
2022-09-09 12:41 caristu Category Retail API => A. Platform
2022-09-09 12:41 caristu Relationship added related to 0048579
2022-09-09 12:49 caristu Status new => scheduled
2022-09-27 13:52 hgbot Resolution open => fixed
2022-09-27 13:52 hgbot Status scheduled => closed
2022-09-27 13:52 hgbot Fixed in Version => PR22Q4
2022-09-27 13:52 hgbot Note Added: 0141403
2022-09-27 13:52 hgbot Note Added: 0141404
2022-09-27 13:53 caristu Summary Write access should not be done when flushing bobs created/edited in admin mode => Write access should not be done when flushing dirty changes of bobs saved in admin mode
2022-09-27 13:53 caristu Description Updated View Revisions
2022-09-27 13:53 caristu Steps to Reproduce Updated View Revisions
2022-09-29 11:33 caristu Assigned To Triage Platform Conn => caristu
2023-10-26 11:03 njimenez Relationship added related to 0053767


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker