Skip to content
Snippets Groups Projects
Unverified Commit 48b4da63 authored by Olivier Dony's avatar Olivier Dony
Browse files

[IMP] res.users: remove special case for sudo() in read_group

Neither the super-user nor the sudo() mode should need
to use read_group() on any of the private user fields.
So we can simplify the code and remove this special case.

The same is not true for read(), though.
parent 2e714966
Branches
Tags
No related merge requests found
......@@ -312,10 +312,9 @@ class Users(models.Model):
@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
if self._uid != SUPERUSER_ID:
groupby_fields = set([groupby] if isinstance(groupby, basestring) else groupby)
if groupby_fields.intersection(USER_PRIVATE_FIELDS):
raise AccessError(_("Invalid 'group by' parameter"))
groupby_fields = set([groupby] if isinstance(groupby, basestring) else groupby)
if groupby_fields.intersection(USER_PRIVATE_FIELDS):
raise AccessError(_("Invalid 'group by' parameter"))
return super(Users, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
@api.model
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment