auth.has_membership and auth.has_permission are both documented here: http://web2py.com/books/default/chapter/29/9#Authorization
Anthony On Monday, March 12, 2012 11:34:11 AM UTC-4, 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 > > >