WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 7 hours ago

#40265 new enhancement

Introduce an 'All Network Users' view to multisite user list tables

Reported by: johnbillion Owned by:
Milestone: 5.6 Priority: normal
Severity: normal Version: 3.0
Component: Users Keywords: has-patch has-screenshots needs-testing 2nd-opinion
Focuses: multisite Cc:

Description

Bulk managing users on WordPress multisite is not an easy process.

As part of a push to improve the ability of network administrators to bulk add users to sites, I'm proposing the introduction of an All Network Users view when viewing the Users screen for an individual site on Multisite, and on the Users tab when editing a site from the network admin screen.

The benefit this provides is that a network administrator can quickly add users to a site in bulk; something that's not currently possible without the aid of a bulk user management plugin or WP-CLI.

Attachments (3)

40265.diff (6.2 KB) - added by johnbillion 3 years ago.
all-network-users.png (172.5 KB) - added by johnbillion 3 years ago.
40265.2.diff (6.1 KB) - added by johnbillion 7 weeks ago.

Download all attachments as: .zip

Change History (22)

@johnbillion
3 years ago

#1 @johnbillion
3 years ago

  • Keywords has-patch has-screenshots needs-testing added; needs-patch needs-screenshots removed

40265.diff does the following:

  • Adds an All Network Users filter to the Users screen when editing a site from network admin, and when viewing the Users screen on an individual site on Multisite.
  • Allows a network administrator to bulk add users to a site by checking their checkboxes and choosing a role from the Change role to... dropdown.
  • Potentially breaks on single site installations. Needs some testing.

In addition, there is a bug which causes the main site's role to be displayed next to a user when viewing the All Network Users filter from the site editing screen. This is probably related to the combination of switch_to_blog() and wp_roles() which doesn't appear to be working as expected.

Last edited 3 years ago by johnbillion (previous) (diff)

#2 @flixos90
3 years ago

Generally +1 for this.

However I'm thinking it might be better to only add this to the Site Users screen in the network admin. I think the Users screen of an individual site should remain without network functionality at this point. If we ever revisit the entire Site section in the network admin and decide to merge these things together with single site, this would be another issue, but for now I'd suggest to keep these separated.

#3 @ocean90
3 years ago

Related: #18162

#4 @johnbillion
3 months ago

#18162 was marked as a duplicate.

#5 @johnbillion
3 months ago

  • Keywords needs-refresh added

#6 @johnbillion
3 months ago

  • Milestone changed from Awaiting Review to 5.5

This ticket was mentioned in Slack in #core-multisite by johnbillion. View the logs.


3 months ago

This ticket was mentioned in Slack in #core-multisite by johnbillion. View the logs.


8 weeks ago

This ticket was mentioned in Slack in #core-multisite by johnbillion. View the logs.


7 weeks ago

@johnbillion
7 weeks ago

#10 @johnbillion
7 weeks ago

  • Keywords needs-refresh removed

40265.2.diff is a refreshed patch. The bug I mentioned in comment:1 where the user's role for the main site shows on the All Network Users filter of the Users tab when editing a site other than the main one still exists. Gonna look into it.

This ticket was mentioned in Slack in #core-multisite by paaljoachim. View the logs.


6 weeks ago

#12 @paaljoachim
6 weeks ago

In regards to handling users.

  1. I expected a way to handle users in the Network: Admin (main site) -> Users -> All Users screen. (I am not sure if this should be allowed in the sub sites. Or perhaps the same interface should be for all sub sites as well as the main site.)
  2. A way to add multiple users.
  3. Selecting which user roles these should have.
  4. Select which site or sites the user is associated with.

Associated plugin: https://wordpress.org/plugins/multisite-user-management/

Last edited 6 weeks ago by paaljoachim (previous) (diff)

#13 @johnbillion
6 weeks ago

This change is for bulk managing the users for a site. You're asking for bulk managing the sites of a user, which isn't related to this feature.

#14 follow-up: @flixos90
5 weeks ago

Revisiting this, I'm thinking this may be better suited as a contextual bulk action in the Network Users screen? This is where all network users are properly listed, and we could build UI for a special bulk action like:

  1. "Add to site..."
  2. Dropdowns show to choose site and role to grant for the site

While this is more implementation work, I think it's a more appropriate solution. Adding an "All Network Users" view to the site users tables is confusing, as these views are separated by roles, and this would introduce a different type of separation.

#15 in reply to: ↑ 14 @johnbillion
5 weeks ago

@flixos90 Thanks for the suggestion! But... I don't think I agree with what you said. The current proposal operates within the context of the site, meaning the users' current roles are shown in the All Network Users list. If you place this functionality in the network users screen, and therefore change the context, it's not possible to determine ahead of time whether a given user or users are a member of the target site, and what their role is, because you're not operating within the context of a site.

I originally shared your concern about the All Network Users tab not fitting into the "Roles" filters, but after using it on and off on a few projects I've come to really like it. I don't find it out of place, and I would favour including it as an available filter on the Users screen in the site's regular admin area too, in addition to the Sites screen when editing a site from network admin.

The only potential benefit of being able to assign users to a site from the Network Admin -> Users screen is it could allow you to bulk manage the sites that a user or users are assigned to, but that would require some custom UI controls which have not yet been successfully implemented in core, eg a Select2 control. I think that is separate from the problem I'm trying to solve here, and I'd definitely be interested in solving that but in another ticket.

#16 @flixos90
5 weeks ago

@johnbillion That's a fair point, maybe there's another way we can cater for that though. I remember another Trac ticket (don't recall the number) where we were discussing inclusion of a "no role" view for user tables in general. I wonder if something along these lines would work here to?

  • An additional view "No Role" or something would show users that are on the site but have no role.
  • An additional view "Not part of the site" or something would show all users that are not on the site.

I'm not sure about this approach either, but it feels a bit more natural to me (even though the wording for the view names would be hard to define) because then it's still all more in context of the current site. Having "All Network Users" there looks random and not really fitting into this context, especially since there already is another "All" view that encompasses every user.

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


6 days ago

#18 @davidbaumwald
6 days ago

  • Keywords 2nd-opinion added

#19 @desrosj
7 hours ago

  • Milestone changed from 5.5 to 5.6

This still seems to need more work. If someone is willing to own it for 5.5 (beta 1 is tomorrow), feel free to move it back into the milestone.

Note: See TracTickets for help on using tickets.