选择在Kohana的auth模块中具有特定角色的用户

In the auth module, we have users and roles with a many to many relationship.

My question probably has a simple answer, but I couldn't find it by myself... How would I go about selecting only users having a certain role using ORM? What I'd like to do is something like this:

ORM::factory('user')->with('roles')->where('role','member')->find_all();

but that does not work...

Thank you

You want to do this:

$members = ORM::factory('role', 'member')->users;

You take the role and find it's users, not the other way around.