[wp-trac] [WordPress Trac] #5540: User roles overhaul

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 27 23:36:16 GMT 2007


#5540: User roles overhaul
-------------------------+--------------------------------------------------
 Reporter:  tellyworth   |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.5      
Component:  General      |     Version:           
 Severity:  normal       |    Keywords:  has-patch
-------------------------+--------------------------------------------------
 This patch changes the way user roles are stored, moving them out of the
 usermeta table into a new user_role table.  The API is unchanged and
 should work exactly the same as before, but operations such as fetching a
 list of users by role are much faster and easier to implement with joins.

 It's mostly important to mu and bbpress, but is also relevant to blogs
 with large user tables.  I'm posting it here first for review, an mu patch
 is forthcoming.

 The main changes are:

 * User roles are no longer stored in usermeta wp_capabilities entries.
 They're moved to the new user_role table (blog_id, user_id, role).

 * Per-user capabilities are still supported, and still stored in usermeta
 as before.

 * The upgrade process removes any usermeta wp_capabilities that match role
 names, and insert user_role entries in their place.

 * Old style wp_capabilities roles are still honored if they exist, to
 permit logging in before the upgrade has completed, but will be removed
 during the upgrade.

 The API and upgrade process are unit tested.  The capabilities API works
 exactly the same as before for all cases I've tested.  The main thing that
 needs review here is the upgrade process: it has the potential to lock
 administrators out of the blog if it doesn't work, and it's possible it
 could take a long time on blogs with many users.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5540>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list