On Wed, Apr 6, 2011 at 1:58 AM, Ian Duncan <iand675@gmail.com> wrote:
I currently have a function of type Widget (), and I need to find get the user's authorization (or not) in order to render the appropriate confidential information. How exactly do I get the authorization information? There's currently not really any documentation for this stuff, so I thought I'd ask and see what the best way to do this is.
_______________________________________________
web-devel mailing list
web-devel@haskell.org
http://www.haskell.org/mailman/listinfo/web-devel

I think the function you're looking for is maybeAuth[1]. Since Widget is just a transformer on top of Handler, you can simply use lift:

    myWidget = do
        ma <- maybeAuth
        addJulius ...

HTH,
Michael

[1] http://hackage.haskell.org/packages/archive/yesod-auth/0.3.2/doc/html/Yesod-Helpers-Auth.html#v:maybeAuth