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

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 18 15:45:58 GMT 2009


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

Comment(by Denis-de-Bernardy):

 @hakre:

 The current system goes:

  - users can have multiple roles
  - roles can have multiple caps
  - users can have multiple caps that override those of roles
  - roles and their caps are stored as a serialized array in the options
 table
  - for each user we store the roles, and caps, as a serialized array in
 the user_meta table
  - to get all users who have a role or a cap, we query all users in the
 db, and filter out those that don't have the cap

 The one initially suggested in IRC would have gone:

  - users can have multiple roles
  - roles can have multiple caps
  - users can have multiple caps that override those of roles
  - roles and their caps are stored in newly created tables
  - for each user we store the roles, and caps, in newly created tables
  - to get all users who have a role or a cap, we use these newly created
 tables (5 of them)

 The one we ended up concluding we'd want is this instead:

  - users can have one role
  - roles can have multiple caps
  - roles and their caps are stored as a serialized array in the options
 table
  - for each user, we store the role as a varchar in the user_meta table
  - to get all users with a role or a cap, we query the user_meta table
 directly

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


More information about the wp-trac mailing list