diff --git a/api/handlers/grouphandler.py b/api/handlers/grouphandler.py index 2b55f9fd81f79c743573f454d2329dd95d101327..a006b12096ec9bc1524cb3e06b26fc02492253d9 100644 --- a/api/handlers/grouphandler.py +++ b/api/handlers/grouphandler.py @@ -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) diff --git a/test/integration_tests/python/test_groups.py b/test/integration_tests/python/test_groups.py index 42c457fb3dfda4d73dc391d0cedadc4fd345edc6..9d61487d745bef9420cd64ada8262aa517691683 100644 --- a/test/integration_tests/python/test_groups.py +++ b/test/integration_tests/python/test_groups.py @@ -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