Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

For the Stack Exchange Community Blogs, we have a network install that we've set up. I am being told that the site administrator role is not allowing an option for user editing. On the site's users page when hovering over a user, there is only an option for delete, not one for edit.

The only option related to user permissions is the following, but not really what I'm going for here...

add new users

How can I enable the site administrator to have full control over the users on that specific site?

share|improve this question
add comment

4 Answers

up vote 5 down vote accepted

As explained in the description of the Network Admin Users screen, in a network install (multisite mode) users are

added on a global basis to the entire network, then assigned to specific sites

Normal administrators are not permitted to modify these global profiles, since their privileges extend only to their given site. This task is reserved for super administrators, who have full control across the entire network.

In prior versions of WordPress, when multisite installations relied on separate WordPress MU support, you could define EDIT_ANY_USER to be true in your wp-config.php file. However, since multisite support was natively integrated, I believe that this was removed.

To manage network users from the Network Admin Users screen, a user must belong to a role that has at least the manage_network_users and edit_users permissions. You could try creating a custom role that included these and the standard administrator permissions, but I'm not convinced how effective that would be. Personally, I'd just try to avoid circumventing these restrictions.

share|improve this answer
add comment

Wordpress multisite 3.0 doesn't allow site admins to edit users. http://wordpress.org/support/topic/administrators-cant-edit-users

share|improve this answer
    
this plugin may help with some of it: wordpress.org/extend/plugins/multisite-user-management –  NW Tech May 18 '11 at 0:00
add comment

Perhaps this plugin can help: http://wordpress.org/extend/plugins/extended-super-admins/ in combination with hard-coding the global variable, $super_admins, specific to each site.

It should be able to be set in a hook as the site admin menu is loaded -- not quite sure how to enforce that yet. It seems a promising solution to an issue I'll have to deal with myself, shortly.

See: http://svn.automattic.com/wordpress/trunk/wp-admin/includes/ms.php and note the return if the global, $super_admins is already set.

/**
 * Grants super admin privileges.
 *
 * @since 3.0.0
 * @param int $user_id
 */
function grant_super_admin( $user_id ) {
    global $super_admins;

    // If global super_admins override is defined, there is nothing to do here.
    if ( isset($super_admins) )
        return false;

    do_action( 'grant_super_admin', $user_id );

    // Directly fetch site_admins instead of using get_super_admins()
    $super_admins = get_site_option( 'site_admins', array( 'admin' ) );

    $user = new WP_User( $user_id );
    if ( ! in_array( $user->user_login, $super_admins ) ) {
        $super_admins[] = $user->user_login;
        update_site_option( 'site_admins' , $super_admins );
        do_action( 'granted_super_admin', $user_id );
        return true;
    }
    return false;
}

/**
 * Revokes super admin privileges.
 *
 * @since 3.0.0
 * @param int $user_id
 */
function revoke_super_admin( $user_id ) {
    global $super_admins;

    // If global super_admins override is defined, there is nothing to do here.
    if ( isset($super_admins) )
        return false;

    do_action( 'revoke_super_admin', $user_id );

    // Directly fetch site_admins instead of using get_super_admins()
    $super_admins = get_site_option( 'site_admins', array( 'admin' ) );

    $user = new WP_User( $user_id );
    if ( $user->user_email != get_site_option( 'admin_email' ) ) {
        if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) {
            unset( $super_admins[$key] );
            update_site_option( 'site_admins', $super_admins );
            do_action( 'revoked_super_admin', $user_id );
            return true;
        }
    }
    return false;
}

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.