mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[12.0][MIG] Migrate base_suspend_security
This commit is contained in:
committed by
Holger Brunn
parent
39ca13d316
commit
4801c32f84
3
base_suspend_security/readme/CONTRIBUTORS.rst
Normal file
3
base_suspend_security/readme/CONTRIBUTORS.rst
Normal 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>
|
||||
3
base_suspend_security/readme/DESCRIPTION.rst
Normal file
3
base_suspend_security/readme/DESCRIPTION.rst
Normal 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()`.
|
||||
1
base_suspend_security/readme/ROADMAP.rst
Normal file
1
base_suspend_security/readme/ROADMAP.rst
Normal 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
|
||||
8
base_suspend_security/readme/USAGE.rst
Normal file
8
base_suspend_security/readme/USAGE.rst
Normal 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
|
||||
Reference in New Issue
Block a user