Opened 16 years ago
Closed 14 years ago
#8663 closed enhancement (worksforme)
Allow customizing capabilities prefix through wp-config.php
Reported by: | hudatoriq | Owned by: | hudatoriq |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Role/Capability | Keywords: | has-patch needs-review early |
Focuses: | Cc: |
Description
It's better if we are able to customize the user capabilities prefix. There are some advantages:
- Security improvement.
- Allow users to customize their multiple WP installations and share single user table & capabilities information without hacking the core script.
Right now the user capabilities prefix is always the same as the $table_prefix.
For user table sharing, some people have been practicing it. See this forum thread. We share a database, set different $table_prefix for each installation, define the CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE into the same value. The only problem is, we can't share the same user capabilities list since we can't set the prefix to other value than $wp_prefix. This could be improved if we add conditional statement to see whether the capabilities prefix is already defined in somewhere else (e.g. wp-config.php).
Attachments (2)
Change History (15)
#6
@
16 years ago
- Keywords needs-docs added; tested commit removed
- Milestone changed from 2.8 to 2.9
- Priority changed from high to normal
Moving to 2.9 for now as we are feature freeze and I don't want to change this now.
We need some more documentation of this and it would be good to review all the uses of $wp_db->prefix . capabilities as the one you have modified is not the only one.
#12
@
14 years ago
You can set the $wp_user_roles global in wp-config.php, which will be used on all sites in the network. See WP_Roles::_init().
#13
@
14 years ago
- Milestone Future Release deleted
- Resolution set to worksforme
- Status changed from new to closed
Having done that, plugins can still manipulate capabilites, but they won't be stored in the database, so you can pretty much do whatever you want.
So, being able to customize the cap prefix is unnecessary.
Adding a check whether a CUSTOM_CAPABILITIES_PREFIX is already defined