Changes between Initial Version and Version 1 of Ticket #2787
- Timestamp:
- 06/04/2006 11:03:22 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2787
- Property Owner changed from anonymous to markjaquith
-
Property
Status
changed from
new
toassigned
-
Ticket #2787 – Description
initial v1 1 1 This idea came from a conversation I had with Ryan in #wordpress-dev 2 2 3 '''The Problem''' 3 = The Problem = 4 4 5 The role/cap system is hindered by having much of its data buried in arrays. User2cap is ridiculous. 5 6 6 '''The Solution''' 7 = The Solution = 8 7 9 Roles are meaningless. Getting users who have role X proves nothing, because they could have extra capabilities. Capabilities are the thing you want. ''''Roles are just a capability container... a short way of granting a bunch of capabilities to a user.'''' Once you realize that, you see that what you really need is a cap2users table, that could double as a users2cap table. That gives you one-query access to "what users can do X?" and "What can user X do?" 8 10 9 '''How Roles Fit In''' 11 = How Roles Fit In = 12 10 13 In order for the role2cap table to be correct, it would need to be updated whenever: 11 14 … … 18 21 So we'd need a solid API for this. This is the heavy lifting... done only when something is changed on the back end (infrequent). 19 22 20 '''Schema''' 23 = Schema = 21 24 22 25 * $wpdb->user2cap (per blog) 23 ** u2cid24 ** user_id25 ** cap_id26 ** extra_cap26 * u2cid 27 * user_id 28 * cap_id 29 * extra_cap 27 30 28 31 extra_cap would be a binary flag. Basically, it would say whether or not this cap is associated with a role or not. It would be used on the backend. The scenario is this: … … 31 34 32 35 * $wpdb->usermeta (multiple blogs can share this) 33 ** wp_role => Administrator34 ** wp_otherblog_role => Garbage Collector35 ** wp_otherblog_role => Little League Coach36 * wp_role => Administrator 37 * wp_otherblog_role => Garbage Collector 38 * wp_otherblog_role => Little League Coach 36 39 37 40 Note that a usermeta table can have roles for that user on different blogs and that there can be multiple roles for each user, even on the same blog. That just means that cap2user has all the capabilities of all the roles that the user has, along with all extra caps (marked with extra_cap = 1). … … 39 42 The array that stores the Role => Cap information could stay as an array. It would only be used in API functions on the back end. 40 43 41 Original conversation. 44 = Original conversation = 42 45 43 46 {{{