auth.has_membership(auth.id_group('Member'),auth.user.id):
On Jan 30, 12:41 am, weheh <[email protected]> wrote:
> What's the most concise syntax to find out if a user belongs to a
> group called "paying_member"?
>
> From the looks of it, it seems like I'd have to do something like
> this:
>
> group_id=db(db.auth_group.role=='Member').select()[0].id
> if auth.has_membership(group_id,auth.user.id):
> redirect(URL(r=request,f='member_profile'))
>
> What I'd really like to do is:
>
> if auth.has_membership('Member',auth.user.id):
> redirect(...)
>
> Is there any functionality like this?
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.