[wp-trac] Re: [WordPress Trac] #5540: User roles overhaul
WordPress Trac
wp-trac at lists.automattic.com
Fri Dec 28 02:35:53 GMT 2007
#5540: User roles overhaul
-------------------------+--------------------------------------------------
Reporter: tellyworth | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.5
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+--------------------------------------------------
Comment (by tellyworth):
I can see one relatively simple way to handle the query-users-by-cap thing
with this patch: Implement a find_roles_with_capability($cap_name)
function that would return a list of roles with a given capability. Then
query the user_role table where role in(a, b, c).
That method could work independent of this patch if we assume there is a
get_users_with_roles($role_names) function. Obviously that function would
be trivial to implement with this patch (just a simple query of the
user_role table), and slow and ugly without it (iterating over usermeta
wp_capabilities entries).
A more complete solution would be to have a user_capabilities and/or
role_capabilities table and query a join on that. But I think that's well
and truly overkill, with little extra benefit, so I'll mention it only to
rule it out.
--
Ticket URL: <http://trac.wordpress.org/ticket/5540#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list