[wp-trac] [WordPress Trac] #10201: Switch roles to use single role, and no user-specific caps

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 28 05:54:52 UTC 2009


#10201: Switch roles to use single role, and no user-specific caps
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:             
     Type:  task (blessed)     |      Status:  assigned   
 Priority:  normal             |   Milestone:  2.9        
Component:  Role/Capability    |     Version:  2.8        
 Severity:  normal             |    Keywords:  2nd-opinion
-------------------------------+--------------------------------------------

Comment(by sambauers):

 I don't understand the "extra column per site" requirement. I was saying
 that to make things fast you would need an extra column in wp_usermeta
 that was a varchar so that the meta_value on "XX_capabilities" keys could
 be stored there instead (and indexed).

 But doing that is clutter and ultimately slower than a small separate
 table like:

 {{{
 CREATE TABLE `wp_userroles` (
     `user_id` bigint(20) unsigned NOT NULL default 0,
     `role` varchar(32) NOT NULL default '',
     KEY `user_id` (`user_id`),
     KEY `role` (`role`),
     UNIQUE KEY `user_id__role` (`user_id`, `role`)
 );
 }}}

 Which can be a site specific table too, so in WPMU you could have one for
 each site, e.g.

 {{{
 wp_1_userroles
 wp_2_userroles
 wp_3_userroles
 etc.
 }}}

 Which limits their size and also makes for better portability.

 This is how the plugin for bbPress handles multiple sites in TalkPress.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10201#comment:29>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list