[Dbix-class] Extending 'find' to include constant value for search query

Matt S Trout dbix-class at trout.me.uk
Sat Jun 23 16:10:28 GMT 2007


On Sat, Jun 23, 2007 at 09:46:07AM +1000, Charlie Garrison wrote:
> Good morning,
> 
> On 22/6/07 at 2:26 PM +0100, Matt S Trout 
> <dbix-class at trout.me.uk> wrote:
> 
> >Yeah, but it's still not what you want - you don't want to be overloading
> >find(), you want to be making sure the resultset you end up with has 
> >already
> >had the ->search applied to it, like I said in my previous e-mail.
> 
> Yep, got that, was an overlap in messages. I've used your 
> suggestion and it does exactly what I want.
> 
> >Assuming you're doing this for user permission restrictions, you might
> >want a look at DBIx::Class::Schema::RestrictWithObject ...
> 
> Looks interesting, I'll check that out too. Especially since the 
> permission model I need to implement contains much more than 
> just who the user is.

This sort of situation is where the resultset model really shines - rather
than having to enforce permissions in app code, you simply hand the app
code a schema/resultset where the permissions are already enforced :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Dbix-class mailing list