[wp-hackers] select all users with role X

Ryan Boren ryan at boren.nu
Tue Dec 27 20:36:24 GMT 2005

On Tue, 2005-12-27 at 14:25 -0500, Owen Winkler wrote:
> Ryan Boren wrote:
> > Someone could propose a schema and implement a replacement WP_User class
> > for everyone to argue over.  We could abstract these queries with
> > get_users_with_role() and get_users_with_cap() while we're at it.
> Rather than creating a whole new table mess (this wasn't actually 
> suggested, was it?), just store the capabilities in multiple rows 
> instead of a serialized array.
> SELECT * FROM wp_usermeta WHERE meta_key = 'wp_caps_granted';
> SELECT * FROM wp_usermeta WHERE meta_key = 'wp_caps_denied';
> Any plugin that implements caching/selecting users based on role could 
> use this schema.  Hopefully it could be tested and adopted, since it's a 
> bit more flexible.

That's what I'm playing with right now, but it does not allow us to set
caps to false so that they can override inherited role caps.


More information about the wp-hackers mailing list