Skip to content
Snippets Groups Projects
Commit df825970 authored by Megan Henning's avatar Megan Henning
Browse files

Do not return all groups for admins

parent f68bbf60
No related branches found
No related tags found
No related merge requests found
......@@ -36,13 +36,10 @@ def list_permission_checker(handler, uid=None):
projection = projection or {}
projection['permissions.$'] = 1
else:
if not handler.superuser_request and not handler.user_is_admin:
if not handler.superuser_request:
query = query or {}
projection = projection or {}
if handler.is_true('admin'):
query['permissions'] = {'$elemMatch': {'_id': handler.uid, 'access': 'admin'}}
else:
query['permissions._id'] = handler.uid
query['permissions._id'] = handler.uid
return exec_op(method, query=query, projection=projection)
return f
......
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