Make WordPress Core

Opened 7 years ago

Last modified 4 years ago

#40265 new enhancement

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

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.0
Component: Users Keywords: has-patch has-screenshots
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 (6)

40265.diff (6.2 KB) - added by johnbillion 7 years ago.
all-network-users.png (172.5 KB) - added by johnbillion 7 years ago.
40265.2.diff (6.1 KB) - added by johnbillion 4 years ago.
40265.3.diff (7.1 KB) - added by johnbillion 4 years ago.
Screenshot 2020-09-20 at 22.08.30.png (70.7 KB) - added by johnbillion 4 years ago.
Screenshot 2020-09-20 at 22.08.22.png (53.9 KB) - added by johnbillion 4 years ago.

Download all attachments as: .zip

Change History (30)

@johnbillion
7 years ago

#1 @johnbillion
7 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 7 years ago by johnbillion (previous) (diff)

#2 @flixos90
7 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
7 years ago

Related: #18162

#4 @johnbillion
4 years ago

#18162 was marked as a duplicate.

#5 @johnbillion
4 years ago

  • Keywords needs-refresh added

#6 @johnbillion
4 years ago

  • Milestone changed from Awaiting Review to 5.5

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


4 years ago

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


4 years ago

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


4 years ago

@johnbillion
4 years ago

#10 @johnbillion
4 years 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.


4 years ago

#12 @paaljoachim
4 years 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 4 years ago by paaljoachim (previous) (diff)

#13 @johnbillion
4 years 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
4 years 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
4 years 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
4 years 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.


4 years ago

#18 @davidbaumwald
4 years ago

  • Keywords 2nd-opinion added

#19 @desrosj
4 years 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.

@johnbillion
4 years ago

#20 @johnbillion
4 years ago

  • Keywords needs-screenshots added; has-screenshots needs-testing 2nd-opinion removed

40265.3.diff is the latest refresh of this and addresses some of the concerns that @flixos90 had.

  • When the All Network Users filter is shown, the existing All filter is renamed to All Site Users for clarity
  • The All Network Users is shown on the far left hand side of the list of filters, indicating a sort of hierarchy to the filters
  • Fixes the role display issue by preparing the list table's items after the existing switch_to_blog() call, which should be happening anyway

I stand by my argument in favour of also showing the All Network Users tab on the Users screen of an individual site, I've found this to be very useful in my user management workflow and I'm sure others will too.

Felix raised a great point about introducing the ability to bulk edit the sites that a user or users belong to, but this is out of scope for this ticket. We have an existing means of showing all network users within the context of a site (hence this patch) but we don't have an existing means of showing all network sites within the context of a user. There's probably an existing ticket for this, I'll either dig one out or create one.

Regarding filtering for users with no role, this already exists. It's possible to edit a user and choose No role for this site in the Role dropdown to remove the user's role while retaining the user as a member of the site. The Users screen then gains a No role filter. This also works on single site installations.

#21 @johnbillion
4 years ago

  • Keywords has-screenshots added; needs-screenshots removed

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


4 years ago

#23 @johnbillion
4 years ago

  • Milestone changed from 5.6 to Future Release

This is close, but it deserves a bit more discussion around its UX. From @helen in the core chat just now:

I am curious about the comment that I think is suggesting to make the “All Network Users” view only show users that are not assigned to that site at all

I think this also kind of exacerbates the confusion of “No role for this site” with not being assigned to the site at all

#24 @helen
4 years ago

Just wanted to add that I can certainly see the value here and would likely use it myself, and perhaps Unassigned Network Users or some such is the way to go to best support the bulk add workflow. Not currently opinionated on whether this should remain in the network admin site editing view or if it's reasonable to mix this bit of network management concept into the single site admin context.

Note: See TracTickets for help on using tickets.