Make WordPress Core


Ignore:
Timestamp:
04/22/2010 07:48:13 PM (16 years ago)
Author:
josephscott
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r14176 r14189  
    807807                break;
    808808        case 'edit_user':
    809                 if ( !isset( $args[0] ) || $user_id != $args[0] ) {
    810                         $caps[] = 'edit_users';
    811                 }
     809                // Allow user to edit itself
     810                if ( isset( $args[0] ) && $user_id == $args[0] )
     811                        break;
     812                // Fall through
     813        case 'edit_users':
     814                // If multisite these caps are allowed only for super admins.
     815                if ( is_multisite() && !is_super_admin() )
     816                        $caps[] = 'do_not_allow';
     817                else
     818                        $caps[] = $cap;
    812819                break;
    813820        case 'delete_post':
Note: See TracChangeset for help on using the changeset viewer.