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

Merged
Created Mar 31, 2022 by Vincent Pelletier@vpelletierOwner

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

  • Overview 14
  • Commits 1
  • 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
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: CMFActivity_store_user_in_Message
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7