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
  • !1582

Products.CMFActivity.ActivityTool: Store user object in activity.

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Vincent Pelletier requested to merge vpelletier/erp5:CMFActivity_store_user_in_Message into master Mar 31, 2022
  • Overview 14
  • Commits 1
  • Pipelines 0
  • Changes 2

When spawning an activity, store the current security context's user in the Message object itself, so the activity security context can be re-created with the same security during activity execution.

This allows a user to be modified (different groups, global roles, maybe removed altogether) after they spawned activities and before these activities could run.

It also means that any temporary custom group or global role granted to that user (by a privilege elevation mechanism out of the scope of this change) will still be effective during the activity execution.

This follows the principle that foo.activate(...).bar(...) should be equivalent to its "immediate execution" version foo.bar(...) by ensuring that the security context of the activity is the same as the one which was applied to the code which spawned that activity, independently of any intermediate configuration change - hence improving (deferred and fragmentary) transaction isolation.

This also removes the need to look the user up, then looking up their assignments (and other documents involved in group computation), etc, saving the cost of these calls.

Also, remove redundant user_name argument of Message.changeUser method.

/cc @jm @jerome @georgios.dagkakis

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