I think I've got a fix and I'm running through the tests now. I will check in shortly if all goes well. Apparently the issue is that viewablePools is a List[Long], which no longer matches Set[Long].
Ethan On Wed, May 12, 2010 at 4:53 AM, Richard Hirsch <[email protected]>wrote: > Vassil is right - findMapDb isn't working any more. > > I'm assuming that viewablePools is always empty, it looks like " > Privilege.findViewablePools(user.id.is)" isn't even being called. No idea > why - might be the "yield" > > D. > > override def findMapDb[T](dbId : ConnectionIdentifier, by : > QueryParam[Message]*)(f : (Message) => Box[T]): List[T] = { > // modify behavior of find methods so that results include only > authorized pools of current user > val user = User.currentUser > > val viewablePools = > for (user <- User.currentUser) yield { > println ("user.id.is: " + user.id.is); > Privilege.findViewablePools(user.id.is) > } > > > val newQueryParams: Seq[QueryParam[Message]] = viewablePools match { > case Full(pools: Set[Long]) if !pools.isEmpty => List( > BySql(" POOL in ( ?" + ( ", ?" * (pools.size - 1)) + " ) OR POOL IS > NULL ", > IHaveValidatedThisSQL("vdichev", "22 June 2009"), > pools.toSeq:_*) > ) > case _ => Nil > } > logger.info("Pool Modified query newQueryParams: " + newQueryParams) > val modifiedQueryParams = by ++ newQueryParams > logger.info("Pool Modified query: " + modifiedQueryParams) > super.findMapDb(dbId, modifiedQueryParams:_*)(f) > } > > > > On Tue, May 11, 2010 at 4:19 PM, Vassil Dichev <[email protected]> wrote: > > > > @Vassil - where are the lift finders? > > > > There's findMapDb in Message.scala, which was supposed to be called by > > everything which implements a mapper (such as Message). This is > > brittle and doesn't seem to work, however, probably Lift 2.0 changed > > their find method hierarchy. > > >
