auth.has_membership(auth.id_group('Member'),auth.user.id):

On Jan 30, 12:41 am, weheh <richard_gor...@verizon.net> 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 web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to