[12.0][MIG] Migrate base_suspend_security

This commit is contained in:
Denis Robinet (ACSONE)
2019-02-11 08:33:07 +01:00
committed by Holger Brunn
parent 39ca13d316
commit 4801c32f84
17 changed files with 532 additions and 173 deletions

View File

@@ -0,0 +1,3 @@
* Holger Brunn <hbrunn@therp.nl>
* Laurent Mignon <laurent.mignon@acsone.eu>
* Frédéric Garbely <frederic.garbely@braintec-group.com>

View File

@@ -0,0 +1,3 @@
This module was written to allow you to call code with some `uid` while being sure no security checks (`ir.model.access` and `ir.rule`) are done. In this way, it's the same as `sudo()`, but the crucial difference is that the code still runs with the original user id. This can be important for inherited code that calls workflow functions, subscribes the current user to some object, etc.
Usually, you'll be in in the situation to want something like this if you inherit from a module you can't or don't want to change, and call `super()`.

View File

@@ -0,0 +1 @@
* the magic works by wrapping uid in a marker class, so if some code unwraps this in the calling tree, security checks will be reenabled

View File

@@ -0,0 +1,8 @@
To use this module, you need to:
* depend on this module
* call `yourmodel.suspend_security().function_to_run()`, just the same as you would use `sudo()`
For further information, please visit:
* https://www.odoo.com/forum/help-1