I will implement it into my own MetaMapper-sub-trait so all of my
models can share the code.

Thank you all for your input!

On Jan 21, 9:44 am, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> Naftoli Gugenheim <naftoli...@gmail.com> writes:
> > Why not define a new method?
> > def findByCurUser(params: QueryParam*) = User.currentUser.flatMap(user=> 
> > find((Seq(By(User.username, user.username.is)) ++ params): _*))
> > find returns a Box and currentUser does too, so flatMap flattens them into 
> > one. Basically find takes a varargs and you're passing a Seq instead using 
> > : _*, and that Seq contains the user and other params.
> > You could probably write params + By(User.username, user.username.is) 
> > instead of the reverse order, as it's shorter than the previous version.
>
> The problem with this solution is that you cannot use any of Lift's
> builtin stuff such as CRUDify.
>
> If you wan't to create a multitenant service with only a single set of 
> tables, you wan't do make damn
> sure that each customer only sees his/her own data :-)
>
> /Jeppe
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to