The various auth.requires... functions are strictly decorators. If you just 
need to test for membership, do:

{{if auth.has_membership('admin'):}}

See http://web2py.com/book/default/chapter/08#Authorization. 

Anthony

On Sunday, December 11, 2011 6:22:20 PM UTC-5, Vincenzo Ampolo wrote:
>
> Hi,
> is there a way to use auth.requires_membership('admin') in templates? i 
> tried :
>
>   {{if auth.requires_membership('admin'):}}
>              <a href="{{=URL(c='admin')}}">Admin</a>
>          {{pass}}
>
>
> because :
>
> print auth.requires_membership('admin')
> <function decorator at 0x38ddc08>
>
> How can i use auth.* ACs in templates?
>
> thanks.
>
> -- 
> Vincenzo Ampolo
> http://vincenzo-ampolo.net
> http://goshawknest.wordpress.com
>
>

Reply via email to