minimize the numer of queries to database while checking permissions
This needs to be updated for the Kohana coding styles. See: http://kohanaframework.org/3.2/guide/kohana/conventions
Also I'm not sure selecting all the roles every time is a good idea. It seems like it would be better to just select the roles they requested, and cache those results. If they request a role that isn't in the cache you would do a lookup. I guess the way you have it makes sense though if the goal is to avoid extra database queries (remember duplicate queries can be cached anyway, so the overhead is low).
Apologies, Just restored CI server from backup .. Its not quite fixed yet ;) Ignore those last messages!
I am not sure how I feel about this, especially since it's targeted for 3.2/develop. There are applications which heavily rely on roles and we might also be able to have instances of the same model using different databases in one of the next releases. Closing this 'for now' because of the target version and conventions (conditions inside of conditions with terminating commands).
I'll be glad to re-open it if there is interest.