15

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?

8

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.

3

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

2

This worked for me: http://thereforei.am/2011/03/15/how-to-allow-administrators-to-edit-users-in-a-wordpress-network/

  • This is a perfect answer for this... – MxmastaMills Apr 7 '16 at 22:09
0

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;
}

0

If you go to "Network Settings" as the super admin, you will see an option

Add New User: Allow site administrators to add new users to their site via the "Users → Add New" page

Simply check this option.

That will allow normal non-super sub-site administrators to add new users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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