Suspend security checks for a call
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().
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:
Known issues / Roadmap
- 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
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size odoo11_addon_base_suspend_security-22.214.171.124.1-py2.py3-none-any.whl (43.9 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View hashes|
Hashes for odoo11_addon_base_suspend_security-126.96.36.199.1-py2.py3-none-any.whl