[wpmu-trac] [WordPress MU Trac] #753: promote_if_site_admin() clobbers added capabilities for site admin

WordPress MU Trac wpmu-trac at lists.automattic.com
Mon Oct 6 05:34:14 GMT 2008


#753: promote_if_site_admin() clobbers added capabilities for site admin
------------------------+---------------------------------------------------
 Reporter:  phlux0r     |       Owner:  somebody                
     Type:  defect      |      Status:  new                     
 Priority:  normal      |   Milestone:  WPMU 2.0                
Component:  component1  |     Version:  2.0                     
 Severity:  critical    |    Keywords:  capabilities, site admin
------------------------+---------------------------------------------------
 If additional capabilities are assigned to the site admin,
 promote_if_site_admin() will overwrite them as it sets:
 $user->{$cap_key} = array( 'administrator' => '1' );

 Suggested solution merge the administrator capability with the existing
 capabilities:

 $user->{$cap_key} = array_merge(array( 'administrator' => '1' ),
 $user->{$cap_key});// FIX: merge the arrays to account for additional
 capabilities

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/753>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list