Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 136
    • Merge requests 136
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !1846

Merged
Created Nov 16, 2023 by Jérome Perrin@jeromeOwner

DMS: handle gracefully unauthorized ingestion scenarios

  • Overview 2
  • Commits 1
  • Pipelines 7
  • Changes 6

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.

Edited Nov 20, 2023 by Jérome Perrin
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: fix/contribution_tool_erase_doc
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7