You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.1 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :alt: License: AGPL-3
  3. Suspend security
  4. =====================
  5. 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.
  6. 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()`.
  7. Usage
  8. =====
  9. To use this module, you need to:
  10. * depend on this module
  11. * call `yourmodel.suspend_security().function_to_run()`, just the same as you would use `sudo()`
  12. For further information, please visit:
  13. * https://www.odoo.com/forum/help-1
  14. Known issues / Roadmap
  15. ======================
  16. * 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
  17. Bug Tracker
  18. ===========
  19. Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
  20. In case of trouble, please check there if your issue has already been reported.
  21. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  22. `here <https://github.com/OCA/server-tools/issues/new?body=module:%20base_suspend_security%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  23. Credits
  24. =======
  25. Contributors
  26. ------------
  27. * Holger Brunn <hbrunn@therp.nl>
  28. Maintainer
  29. ----------
  30. .. image:: https://odoo-community.org/logo.png
  31. :alt: Odoo Community Association
  32. :target: https://odoo-community.org
  33. This module is maintained by the OCA.
  34. OCA, or the Odoo Community Association, is a nonprofit organization whose
  35. mission is to support the collaborative development of Odoo features and
  36. promote its widespread use.
  37. To contribute to this module, please visit http://odoo-community.org.