[web-devel] Auth plugin usage questions

Michael Snoyman michael at snoyman.com
Wed Apr 6 05:35:11 CEST 2011


On Wed, Apr 6, 2011 at 1:58 AM, Ian Duncan <iand675 at 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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110406/2444d995/attachment.htm>


More information about the web-devel mailing list