Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028842Openbravo ERPA. Platformpublic2015-02-03 12:412016-06-17 19:36
jecharri 
NaroaIriarte 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q2 
AugustoMauch
Google Chrome
Core
No
0028842: When you attach a file, the created record in table c_file has context organization instead of document organization
When you attach a file, the created record in table c_file has context organization instead of document organization
-Login to ERP
-Your context should have "EspaƱa Norte" organization
-Go to window sales order and select an org with organization "F&B US East Coast"
-Attach a file
-Login with a role that only have access to "F&B US East Coast" verify that can not see attached file

The problem is that created record in table c_file has the context organization instead of document organization.

It could be necessary a modulescript
No tags attached.
related to defect 0029057 closed AugustoMauch When you create a note, the created record in table has context organization instead of document organization 
related to defect 00290643.0PR15Q3 closed NaroaIriarte When you create a note, the created record in table obuiapp_note has context organization instead of document organization 
related to defect 00293133.0PR15Q2 closed alostale Download attachments selecting several records is not working fine 
related to defect 0029326 closed alostale attachment download from multi record does not perform correct organization access check 
Issue History
2015-02-03 12:41jecharriNew Issue
2015-02-03 12:41jecharriAssigned To => AugustoMauch
2015-02-03 12:41jecharriWeb browser => Google Chrome
2015-02-03 12:41jecharriModules => Core
2015-02-03 12:41jecharriResolution time => 1425510000
2015-02-03 12:41jecharriTriggers an Emergency Pack => No
2015-02-04 03:54Guillaume_JumpNote Added: 0074063
2015-02-09 12:38alostaleStatusnew => scheduled
2015-02-09 12:38alostaleAssigned ToAugustoMauch => NaroaIriarte
2015-02-09 12:38alostalefix_in_branch => pi
2015-02-25 08:40alostaleRelationship addedrelated to 0029057
2015-02-25 13:15caristuRelationship addedrelated to 0029064
2015-03-04 12:17AugustoMauchIssue Monitored: AugustoMauch
2015-03-04 12:17AugustoMauchReview Assigned To => AugustoMauch
2015-03-04 12:17AugustoMauchWeb browserGoogle Chrome => Google Chrome
2015-03-04 12:17AugustoMauchfix_in_branchpi =>
2015-03-04 12:18hgbotCheckin
2015-03-04 12:18hgbotNote Added: 0075150
2015-03-04 12:18hgbotStatusscheduled => resolved
2015-03-04 12:18hgbotResolutionopen => fixed
2015-03-04 12:18hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/afec99f5af4390c1360af46f504bd7399f709f32 [^]
2015-03-04 12:19AugustoMauchNote Added: 0075151
2015-03-04 12:19AugustoMauchStatusresolved => closed
2015-03-04 12:19AugustoMauchFixed in Version => 3.0PR15Q2
2015-03-04 12:26AugustoMauchWeb browserGoogle Chrome => Google Chrome
2015-03-04 12:26AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7840#r7840
2015-03-04 12:27AugustoMauchNote Added: 0075152
2015-03-04 15:02hgbotCheckin
2015-03-04 15:02hgbotNote Added: 0075159
2015-03-05 17:01hudsonbotCheckin
2015-03-05 17:01hudsonbotNote Added: 0075206
2015-03-05 17:01hudsonbotCheckin
2015-03-05 17:01hudsonbotNote Added: 0075207
2015-03-18 08:59alostaleRelationship addedrelated to 0024289
2015-03-18 08:59alostaleRelationship deletedrelated to 0024289
2015-03-18 09:01alostaleRelationship addedrelated to 0029313
2015-03-18 09:19alostaleRelationship addedrelated to 0029326
2016-04-18 13:02hgbotCheckin
2016-04-18 13:02hgbotNote Added: 0085698
2016-04-18 13:02hgbotStatusclosed => resolved
2016-04-18 13:02hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/afec99f5af4390c1360af46f504bd7399f709f32 [^] => http://code.openbravo.com/erp/devel/pi/rev/98cf7142eebe2d555da6108bb5f51f68cc325afb [^]
2016-04-18 13:02hgbotCheckin
2016-04-18 13:02hgbotNote Added: 0085699
2016-04-19 09:54gorkaionNote Added: 0085734
2016-04-19 09:54gorkaionStatusresolved => closed
2016-06-17 19:36hudsonbotCheckin
2016-06-17 19:36hudsonbotNote Added: 0087457
2016-06-17 19:36hudsonbotCheckin
2016-06-17 19:36hudsonbotNote Added: 0087458

Notes
(0074063)
Guillaume_Jump   
2015-02-04 03:54   
Good Morning,

Doing more tests on that we found that the same problem also applies to Notes.
(0075150)
hgbot   
2015-03-04 12:18   
Repository: erp/devel/pi
Changeset: afec99f5af4390c1360af46f504bd7399f709f32
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Thu Feb 26 13:45:06 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/afec99f5af4390c1360af46f504bd7399f709f32 [^]

Fixed issue 28842: There are problems to handle attachments.

There were two problems:
First: When storing an attachment in the database (c_file table), the current
 organization of the user was used instead of the organization of the document where the
file is being attached to. The aim of this fix is to take the value of the organization
of the attached document instead of the current user organization.
Second: When an attachment was created with an organization and after that, the
 organization of the document was changed, it was not possible to download it, update it nor delete
it with a user who does not have access to the organization used to create the attachment.

To fix the first part, a new field that stores the document organization has been added to the canvas
 of the OBAttachmentsSectionItem class in the fillAttachments function. After that the
 field is sent as a param in the request, and can be used in the TabAttachments.java class
to be included to create the new record in c_file.

To fix the second part, the way the attachments are retrieved in the TabAttachments and in the
AttachmentsAH classes has been modified. Now the automated organization filter is disabled,
so the organization of the attachment is not taken into accout. It is needed that the user has at
least readable access to the document's organization for downloading, deleting or editing its attachments
a new method has been added to the SecurityChecker class for checking this.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/AttachmentsAH.java
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-attachments.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
M src/org/openbravo/dal/security/SecurityChecker.java
M src/org/openbravo/erpCommon/businessUtility/TabAttachments.java
---
(0075151)
AugustoMauch   
2015-03-04 12:19   
Code reviewed and verified in pi@afec99f5af43
(0075152)
AugustoMauch   
2015-03-04 12:27   
A module script was not needed, as now the organization of the attachment (which was the data that would have been needed to be corrected in the modulescript) is not taken into accout to interact (download, edit, remove) with an attachment.

Now, if a user has access to the document where the files are attached to, it will have access to all its attachments.
(0075159)
hgbot   
2015-03-04 15:02   
Repository: erp/devel/pi
Changeset: cc464383f9e11fa224a55341a45914c46433c04f
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Mar 04 15:01:42 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/cc464383f9e11fa224a55341a45914c46433c04f [^]

Related with issue 28842: Improves javadoc of checkReadableAccess method

---
M src/org/openbravo/dal/security/SecurityChecker.java
---
(0075206)
hudsonbot   
2015-03-05 17:01   
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/2369c54c9f14 [^]
Maturity status: Test
(0075207)
hudsonbot   
2015-03-05 17:01   
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/2369c54c9f14 [^]
Maturity status: Test
(0085698)
hgbot   
2016-04-18 13:02   
Repository: erp/devel/pi
Changeset: 98cf7142eebe2d555da6108bb5f51f68cc325afb
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Thu Feb 26 13:45:06 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/98cf7142eebe2d555da6108bb5f51f68cc325afb [^]

Fixed issue 28842: There are problems to handle attachments.

There were two problems:
First: When storing an attachment in the database (c_file table), the current
 organization of the user was used instead of the organization of the document where the
file is being attached to. The aim of this fix is to take the value of the organization
of the attached document instead of the current user organization.
Second: When an attachment was created with an organization and after that, the
 organization of the document was changed, it was not possible to download it, update it nor delete
it with a user who does not have access to the organization used to create the attachment.

To fix the first part, a new field that stores the document organization has been added to the canvas
 of the OBAttachmentsSectionItem class in the fillAttachments function. After that the
 field is sent as a param in the request, and can be used in the TabAttachments.java class
to be included to create the new record in c_file.

To fix the second part, the way the attachments are retrieved in the TabAttachments and in the
AttachmentsAH classes has been modified. Now the automated organization filter is disabled,
so the organization of the attachment is not taken into accout. It is needed that the user has at
least readable access to the document's organization for downloading, deleting or editing its attachments
a new method has been added to the SecurityChecker class for checking this.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/AttachmentsAH.java
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-attachments.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
M src/org/openbravo/dal/security/SecurityChecker.java
M src/org/openbravo/erpCommon/businessUtility/TabAttachments.java
---
(0085699)
hgbot   
2016-04-18 13:02   
Repository: erp/devel/pi
Changeset: b036e3dfa2a5e8924a164e9b237a3582450a2a75
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Mar 04 15:01:42 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b036e3dfa2a5e8924a164e9b237a3582450a2a75 [^]

Related with issue 28842: Improves javadoc of checkReadableAccess method

---
M src/org/openbravo/dal/security/SecurityChecker.java
---
(0085734)
gorkaion   
2016-04-19 09:54   
issue reopened by attachment enhancement project merge. checked that it is not reproduced.
(0087457)
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
(0087458)
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