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