Browse Source
Merge pull request #1049 from StefanRijnhart/fix/password_security/8.0-erp_manager_reset_password
[FIX] As an ERP manager, allow to reset users' passwords
pull/1072/head
Pedro M. Baeza
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
18 additions and
2 deletions
-
password_security/__openerp__.py
-
password_security/security/res_users_pass_history.xml
-
password_security/tests/test_res_users.py
|
@ -5,7 +5,7 @@ |
|
|
|
|
|
|
|
|
'name': 'Password Security', |
|
|
'name': 'Password Security', |
|
|
"summary": "Allow admin to set password security requirements.", |
|
|
"summary": "Allow admin to set password security requirements.", |
|
|
'version': '8.0.1.0.0', |
|
|
|
|
|
|
|
|
'version': '8.0.1.1.0', |
|
|
'author': "LasLabs, Odoo Community Association (OCA)", |
|
|
'author': "LasLabs, Odoo Community Association (OCA)", |
|
|
'category': 'Base', |
|
|
'category': 'Base', |
|
|
'depends': [ |
|
|
'depends': [ |
|
|
|
@ -17,6 +17,13 @@ |
|
|
]</field> |
|
|
]</field> |
|
|
</record> |
|
|
</record> |
|
|
|
|
|
|
|
|
|
|
|
<record id="res_users_pass_history_rule_manager" model="ir.rule"> |
|
|
|
|
|
<field name="name">Res Users Pass History Access/Managers</field> |
|
|
|
|
|
<field name="model_id" ref="password_security.model_res_users_pass_history"/> |
|
|
|
|
|
<field name="groups" eval="[(4, ref('base.group_erp_manager'))]"/> |
|
|
|
|
|
<field name="domain_force">[(1, '=', 1)]</field> |
|
|
|
|
|
</record> |
|
|
|
|
|
|
|
|
</data> |
|
|
</data> |
|
|
</openerp> |
|
|
</openerp> |
|
|
|
|
|
|
|
@ -13,6 +13,16 @@ class TestResUsers(TransactionCase): |
|
|
|
|
|
|
|
|
def setUp(self): |
|
|
def setUp(self): |
|
|
super(TestResUsers, self).setUp() |
|
|
super(TestResUsers, self).setUp() |
|
|
|
|
|
self.main_comp = self.env.ref('base.main_company') |
|
|
|
|
|
# Modify users as privileged, but non-root user |
|
|
|
|
|
privileged_user = self.env['res.users'].create({ |
|
|
|
|
|
'name': 'Privileged User', |
|
|
|
|
|
'login': 'privileged_user@example.com', |
|
|
|
|
|
'company_id': self.main_comp.id, |
|
|
|
|
|
'groups_id': [(4, self.env.ref('base.group_erp_manager').id)], |
|
|
|
|
|
}) |
|
|
|
|
|
privileged_user.email = privileged_user.login |
|
|
|
|
|
self.env = self.env(user=privileged_user) |
|
|
self.login = 'foslabs@example.com' |
|
|
self.login = 'foslabs@example.com' |
|
|
self.partner_vals = { |
|
|
self.partner_vals = { |
|
|
'name': 'Partner', |
|
|
'name': 'Partner', |
|
@ -20,7 +30,6 @@ class TestResUsers(TransactionCase): |
|
|
'email': self.login, |
|
|
'email': self.login, |
|
|
} |
|
|
} |
|
|
self.password = 'asdQWE123$%^' |
|
|
self.password = 'asdQWE123$%^' |
|
|
self.main_comp = self.env.ref('base.main_company') |
|
|
|
|
|
self.vals = { |
|
|
self.vals = { |
|
|
'name': 'User', |
|
|
'name': 'User', |
|
|
'login': self.login, |
|
|
'login': self.login, |
|
|