I like partial functions :) The really nice thing is that you can use
matching. Looks good!
Derek
On Sat, Nov 22, 2008 at 7:47 AM, Tim Perrett <[EMAIL PROTECTED]> wrote:
>
> Ok, i've refactored a whole bunch of stuff.
>
> I used a partial function :-) All a user need to now is something
> like:
>
> object SimpleBasicAuth extends HttpBasicAuthentication {
>
> def verified_? = {
> case((user, pass, req)) => {
> if(user == "tim" && pass == "badger"){
> true
> } else {
> false
> }
> }
> }
>
> }
>
> Obviously this would be replaced by a database, or cache lookup or
> something - what you rekon?
>
> Now I just need to get on to writing the trait for digest processing.
>
> Feedback appreciated.... :)
>
> Cheers, Tim
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---