[wp-hackers] User roles - GSOC proposal

nadarajah prasath n.prasath.002 at gmail.com
Sat Mar 27 13:02:17 UTC 2010


Hi hackers,
I,m interested in the idea user roles.

The objectives of this project is to

   - Simplify the current implementation of roles.
   - Allow category level permissions for roles.
   - Optimized storage for querying user permissions.


The current role system allows you to set capabilities per user basis. It's
flexible but also complicated.
 Capabilities are saved for individual users and it requires loading all the
users into the memory to determine for capability X.
this may give performance issues with high number of users.

I propose to eliminate individual capabilities of user and assign
capabilities for roles.

*Entities*

   - Users – a blog can have any number of user.
   - Roles – a blog can any number of roles. Admin can create custom roles.
   - Categories – post categories.


*Relationships*

   - Users&Roles – a single user can act multiple roles in different
   categories. For example in a news blog the user can act as a contributor to
   sports category and editor  in   entertainment category.
   - Users&Categories – a single user can be assigned to multiple
   categories. For example a user can act as editor for both
   sports&entertainment category.

*Views*

   - Users&Roles&Categories – In individual user view a widget that display
   all roles and a  tree view within the roles to select multiple categories
   (similar in post view where we select categories that post belong).
   - Roles – ability to create custom roles. Capabilities of roles in one
   view so admin has more control and information over capabilities (similar to
   drupal)

*database*
wp_usermap – A database table that maps userId with roleId & termId. So now
checking for user with capability X or checking for a user for a specific
category will be easy. This will increase the performance.

I have given a lot of thought whether to allow users to act in multiple
roles and I think it,s essential for blogs having large users.
 What do you think?.

Feel free to add your comments and feedback on this. i,m eagerly waiting for
it.
Prasath.N


More information about the wp-hackers mailing list