Ah . . . you're right. Sorry for not reading more carefully. I think some of this *has* been documented better since the version 3 book too, which is great.
Ian On Monday, March 12, 2012 11:44:01 AM UTC-4, Richard wrote: > > I think pretty everithing can be find in this chapter if you read it > carefully. > > http://web2py.com/books/default/chapter/29/9#Authorization-and-CRUD > > Your is_member = > > auth.has_membership(group_id, user_id, role) > > * > * > > * > * > > Does it help? > > Richard > > On Mon, Mar 12, 2012 at 11:34 AM, monotasker wrote: > >> In digging through the discussions here I've come across two auth methods >> that allow for checking a user's authorization: >> >> auth.is_logged_in() >> >> and >> >> auth.has_permission() >> >> These are really useful, but aren't documented in the web2py book >> (They're used a couple of times in other recipes, but they're never >> explained or highlighted.) So I'm wondering (a) whether these could be >> highlighted in the authorization chapter; and (b) whether there are other >> similar auth methods. Does, for example, auth.is_member(auth.user_id) exist >> to check for group membership? >> >> Don't get me wrong, the decorators are great. But sometimes I need >> something more fine-grained for (e.g.) controlling visibility of elements >> in a view on a per-role basis. >> >> Thanks, >> >> Ian >> >> >> >