Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 142
    • Merge requests 142
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • erp5erp5
  • Merge requests
  • !1423

ingestion: review publication_state argument

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Jérome Perrin requested to merge fix/contribute_publication_state_sync into master May 24, 2021
  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 4

Changing state directly in Base_contribute was only functional for the case where metadata was discovered asynchronously. In the case of synchronous discovery, the state was first changed state, and Document_convertToBaseFormatAndDiscoverMetadata was executed - but this this was causing Unauthorized like this:

  Module script, line 10, in Document_convertToBaseFormatAndDiscoverMetadata
  - <PythonScript at /erp5/Document_convertToBaseFormatAndDiscoverMetadata used for /erp5/document_module/163>
  - Line 10
    return context.discoverMetadata(filename=filename,
Unauthorized: You are not allowed to access 'discoverMetadata' in this context

because once we have already changed state, regular user no longer have permission to access discoverMetadata, because that method needs ModifyPortalContent permission.

Instead, of handling publication_state only in Base_contribute, treat it like others user input parameter and change state during discovery.

Tests were also re-organised to move Base_contribute related test in testIngestion and also to run Base_contribute tests as a non-manager user.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/contribute_publication_state_sync
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7