I don't know if web2py has a given command or how to use it, but this query should give you what you the information you are searching :
db((db.auth_user.email == 'USER_EMAIL')&(db.auth_membership.user_id == db.auth_user.id)&(db.auth_group.id ==db.auth_membership.group_id)).select(db.auth_group.ALL) Richard On Tue, Oct 30, 2012 at 11:15 AM, Francisco Barretto <[email protected] > wrote: > Hi Folks! > > How do I list all groups that a user belong? I've found out that Auth has > this function: > > groups(self) > displays the groups and their roles for the logged in user > > I dont manage to get it working. I've tried something like this: > > def myGroups(): > return dict(auth.groups(auth.user_id)) > > and get this error: > <type 'exceptions.TypeError'> groups() takes exactly 1 argument (2 given) > > any idea on how to do this properly? Thanks! > > -- > > > > --

