Skip to content
Snippets Groups Projects
Commit 84ad1225 authored by Harsha Kethineni's avatar Harsha Kethineni
Browse files

/users/uid/groups returns permission for uid

parent 27fc60e3
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,7 @@ class GroupHandler(base.RequestHandler):
projection = {'label': 1, 'created': 1, 'modified': 1, 'permissions': 1, 'tags': 1}
permchecker = groupauth.list_permission_checker(self, uid)
results = permchecker(self.storage.exec_op)('GET', projection=projection)
if not self.superuser_request and not self.is_true('join_avatars'):
if not self.superuser_request and not self.is_true('join_avatars') and not self.user_is_admin:
self._filter_permissions(results, self.uid)
if self.is_true('join_avatars'):
results = ContainerHandler.join_user_info(results)
......
......@@ -82,6 +82,11 @@ def test_groups(as_user, as_admin, data_builder):
r = as_admin.put('/groups/' + group + '/permissions/' + user['_id'], json=user)
assert r.ok
# Get all permissions for each group
r = as_admin.get('/users/admin@user.com/groups')
assert r.ok
assert r.json()[0].get("permissions")[0].get("_id") == "admin@user.com"
# Get the group again to compare timestamps for the Edit permission test groups
r = as_admin.get('/groups/' + group)
assert r.ok
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment