cubicweb/pyramid/core.py
changeset 11701 ca536eec556b
parent 11686 41d4f0f3855c
child 11811 f09efeead7f9
--- a/cubicweb/pyramid/core.py	Mon Jun 06 16:08:03 2016 +0200
+++ b/cubicweb/pyramid/core.py	Mon Jun 06 15:37:01 2016 +0200
@@ -348,7 +348,11 @@
         log.exception("Failed")
         raise
 
-    return session.user.groups
+    with session.new_cnx() as cnx:
+        with cnx.security_enabled(read=False):
+            return set(group for group, in cnx.execute(
+                'Any GN WHERE U in_group G, G name GN, U eid %(userid)s',
+                {'userid': login}))
 
 
 def includeme(config):