New 'list_users' cap to provide more controls over listing users vs. editing

users.

Apply this new cap to the 'Authors & Users' menu item and 'Users' page in
wp-admin.

Bump db version to 14139 to pick up the new cap.

See #13074



git-svn-id: http://svn.automattic.com/wordpress/trunk@14189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
josephscott
2010-04-22 19:48:13 +00:00
parent f4ccd9cac3
commit e26aed0ac4
7 changed files with 24 additions and 14 deletions

View File

@@ -806,9 +806,16 @@ function map_meta_cap( $cap, $user_id ) {
$caps[] = 'promote_users';
break;
case 'edit_user':
if ( !isset( $args[0] ) || $user_id != $args[0] ) {
$caps[] = 'edit_users';
}
// Allow user to edit itself
if ( isset( $args[0] ) && $user_id == $args[0] )
break;
// Fall through
case 'edit_users':
// If multisite these caps are allowed only for super admins.
if ( is_multisite() && !is_super_admin() )
$caps[] = 'do_not_allow';
else
$caps[] = $cap;
break;
case 'delete_post':
$author_data = get_userdata( $user_id );

View File

@@ -15,7 +15,7 @@ $wp_version = '3.0-beta1';
*
* @global int $wp_db_version
*/
$wp_db_version = 14138;
$wp_db_version = 14139;
/**
* Holds the TinyMCE version