DMS: handle gracefully unauthorized ingestion scenarios
Instead of using UnrestrictedMethod for the whole duration of discoverMetadata, revert to the original user permissions for the last part where we merge revision or change state, because we want this to fail when user is not allowed. This adjusts also the high level Base_contribute script to catch these errors and report them nicely to the user and while doing this some other problems were discovered and are also fixed. Some problems in ContributionTool.newContent were fixed, this was already trying to detect that a document is going to be merged and synchronously checked that this existing document can be replaced, to display an error to the user, but this part has two issues: - first it was using getMatchedFilenamePatternDict to find the document coordinates, but this method only supports preferred_document_filename_regular_expression capturing reference, but not the combination of node_reference and local_reference, so this was changed to use getPropertyDictFromFilename, which is what is actually used to compute the reference. - The second problem here was that this check was done with a standard restricted catalog search, but later mergeRevision uses an unrestricted search, so this was changed to use unrestricted catalog search to match mergeRevision The testing also revealed that the PDFDocument._setFile hack to clear the _content_information was only for _setFile, but not for _setData, so this was extended to _setData as well, so that a case where the PDF content is updated by setData also update content information.
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
passed |
#628082
external
|
ERP5.CodingStyleTest-TestRunner2 |
02:20:28
|
||||||
failed |
#628085
external
|
ERP5.UnitTest-TestRunner2 |
03:31:12
|
||||||
passed |
#628084
external
|
ERP5.UnitTest-Zope2-ForTestRunner2 |
03:38:16
|
||||||
passed |
#627686
external
retried
|
ERP5.CodingStyleTest-TestRunner2 |
01:47:58
|
||||||
passed |
#627866
external
retried
|
ERP5.CodingStyleTest-TestRunner2 |
02:05:21
|
||||||
passed |
#627041
external
retried
|
ERP5.CodingStyleTest-TestRunner2 |
00:28:42
|
||||||
passed |
#627433
external
retried
|
ERP5.CodingStyleTest-TestRunner2 |
01:10:33
|
||||||
passed |
#627531
external
retried
|
ERP5.CodingStyleTest-TestRunner2 |
01:00:07
|
||||||
passed |
#627314
external
retried
|
ERP5.CodingStyleTest-TestRunner2 |
01:07:05
|
||||||
passed |
#627584
external
retried
|
ERP5.CodingStyleTest-TestRunner2 |
00:56:22
|
||||||
failed |
#627317
external
retried
|
ERP5.UnitTest-TestRunner2 |
02:05:16
|
||||||
failed |
#627695
external
retried
|
ERP5.UnitTest-TestRunner2 |
03:09:29
|
||||||
passed |
#627582
external
retried
|
ERP5.UnitTest-TestRunner2 |
02:21:48
|
||||||
failed |
#627899
external
retried
|
ERP5.UnitTest-TestRunner2 |
02:48:18
|
||||||
passed |
#627442
external
retried
|
ERP5.UnitTest-TestRunner2 |
02:05:38
|
||||||
failed |
#627042
external
retried
|
ERP5.UnitTest-TestRunner2 |
01:52:36
|
||||||
failed |
#627915
external
retried
|
ERP5.UnitTest-Zope2-ForTestRunner2 |
02:57:30
|
||||||
failed |
#627331
external
retried
|
ERP5.UnitTest-Zope2-ForTestRunner2 |
02:01:01
|
||||||
failed |
#627427
external
retried
|
ERP5.UnitTest-Zope2-ForTestRunner2 |
02:06:04
|
||||||
failed |
#627581
external
retried
|
ERP5.UnitTest-Zope2-ForTestRunner2 |
02:24:00
|
||||||
failed |
#627688
external
retried
|
ERP5.UnitTest-Zope2-ForTestRunner2 |
03:56:20
|
||||||
passed |
#627040
external
retried
|
ERP5.UnitTest-Zope2-ForTestRunner2 |
01:51:59
|
||||||