-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] impersonate_login: Restrict Admin settings impersonation
- Loading branch information
Showing
10 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,10 @@ following measures are in place: | |
- Mails and messages are sent from the original user. | ||
- Impersonated logins are logged and can be consulted through the | ||
Settings -> Technical menu. | ||
- | ||
- To prevent users with "Administration: Settings" rights from being impersonated, | ||
enable the restrict_impersonate_admin_settings field in the settings. | ||
This will restrict the ability to impersonate users with administrative | ||
access to the settings. | ||
|
||
There is an alternative module to allow logins as another user | ||
(auth_admin_passkey), but it does not support these security mechanisms. | ||
|
@@ -81,6 +84,8 @@ Contributors | |
- Kévin Roche <[email protected]> | ||
- [360ERP](https://www.360erp.com): | ||
- Andrea Stirpe | ||
- `Ooops404 <https://www.ooops404.com/>`_: | ||
- Eduard Brahas <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
from . import mail_message | ||
from . import impersonate_log | ||
from . import model | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
restrict_impersonate_admin_settings = fields.Boolean( | ||
string="Restrict Impersonation of 'Administration: Settings' Users", | ||
config_parameter="impersonate_login.restrict_impersonate_admin_settings", | ||
help="If enabled, users with the 'Administration: Settings' access right" | ||
" cannot be impersonated.", | ||
default=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
- Kévin Roche <[email protected]> | ||
- [360ERP](https://www.360erp.com): | ||
- Andrea Stirpe | ||
- `Ooops404 <https://www.ooops404.com/>`_: | ||
- Eduard Brahas <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<odoo> | ||
<record id="view_res_config_settings_impersonate" model="ir.ui.view"> | ||
<field name="name">res.config.settings.impersonate</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@id='invite_users']" position="after"> | ||
<div id="impersonate_login"> | ||
<h2>Impersonation Login</h2> | ||
<div | ||
class="row mt16 o_settings_container" | ||
name="impersonate_login_settings_container" | ||
> | ||
<div | ||
class="col-12 col-lg-6 o_setting_box" | ||
id="impersonate_login_settings" | ||
> | ||
<div class="o_setting_right_pane"> | ||
<label for="restrict_impersonate_admin_settings"> | ||
Restrict Impersonation Login | ||
</label> | ||
<field | ||
name="restrict_impersonate_admin_settings" | ||
string="Restrict Impersonation of 'Administration: Settings' Users" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |