[Rt-devel] [PATCH] More ACL checks from cache

Jesse Vincent jesse at bestpractical.com
Mon Apr 24 11:11:17 EDT 2006




> > Any basic stats on how effective this is?  I think I'm most comfortable
> When you have SuperUser right on the system you need only one request to the DB.
> It works pretty simple. If you have right ShowTicket on the Queue then
> we put into cache record 'your_id,ShowTicket,Queue-XXX'. Then when we
> check the right on any ticket from the Queue its object is one of the
> equivalence objects for ticket and we fetch this info from cache.
> This trick doesn't work for role-checks because of inability to get
> real object you have right on.

Ok. It's probably worht adding that description as a comment in that
code.


> > starting with this in 3.7, since 3.6 is so close to going out the door.
> Heh, I don't mind if this prove concept and usefulness then I'm happy
> to apply to any branch.

Indeed it does. 3.7 gives me the most comfort.

> > I know it's pedantic, but can this get turned into something that reads
> > a little easier to someone poking at the code?
> This is one the most commented code, but anyway took several tries to
> understand whole piture.

*nod*

> >
> > (also $big_hashkey doesn't tell me what it's for, just that it's large
> > ;)
> bundle_hashkey? I don't know how to call it, it's really big hashkey
> that contains references to all equiv objects.

$user_object_and_right ?


> >
> > > +    $_ACL_CACHE->set( $big_hashkey => $hitcount? 1:-1 );

So it would end up as:  (the extra paren makes it a little more readable
to me.

  $_ACL_CACHE->set( $user_object_and_right =>  ($hitcount? 1:-1) );





More information about the Rt-devel mailing list