I don't think that's the purpose of this method. It appears its only purpose is to provide the user-specific role assigned to each user upon registration, which is only relevant if auth.settings.create_user_groups is set. It might be a good idea if it checked for auth.settings.create_user_groups and returned None in that case rather than generating an error, though.
Anthony On Friday, August 10, 2012 12:14:20 AM UTC-4, cyan wrote: > > > This method seems to be still in trunk ( > http://code.google.com/p/web2py/source/browse/gluon/tools.py#2832), as I > cannot find it in the latest stable. > > It takes a user id and return the name/role of the group that user is in. > However, it doesn't seem to be able to work with custom groups. For > example, if I do > > auth.settings.create_user_groups = False > > and create two custom groups (e.g. 'students' and 'teachers') to > accomodate all the users. This auth.user_group_role() method probably will > fail because it assume that every group follows the naming convention which > is set by: > http://code.google.com/p/web2py/source/browse/gluon/tools.py#963. > > Can someone confirm whether this is indeed the case. Thanks! > --

