Skip to content
Permalink
Browse files

⚡️ res_users_clear_access_rights New: does not clear user type when c…

…lear access rights
  • Loading branch information...
Ommo73 committed Jul 30, 2019
1 parent d4314b4 commit b71f963254973c42144e0c63b57a59b2cf98b9c1
@@ -1,7 +1,7 @@
{
'name': 'Clear access rights button',
"summary": """Useful tool to reset user rights""",
'version': '12.0.1.0.0',
'version': '12.0.1.1.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
"support": "apps@it-projects.info",
@@ -1,3 +1,8 @@
`1.1.0`
-------

- **New**: does not clear user type when clear access rights

`1.0.0`
-------

@@ -13,10 +13,17 @@ def action_clear_access_rights(self):
self.env.ref('base.group_system').id,
]

user_types = [
self.env.ref('base.group_portal').id,
self.env.ref('base.group_public').id,
self.env.ref('base.group_user').id,
]

groups_id = []
for g in self.groups_id:
if self.env.uid == self.id and g.id in admin_groups:
if self.env.uid == self.id and g.id in admin_groups or g.id in user_types:
# don't allow for Administrator to clear his admin rights
# don't clear user type
continue
groups_id.append((3, g.id))
self.write({'groups_id': groups_id})

0 comments on commit b71f963

Please sign in to comment.
You can’t perform that action at this time.