[wp-trac] [WordPress Trac] #22959: Show all roles in user list table
WordPress Trac
noreply at wordpress.org
Tue May 12 07:31:30 UTC 2015
#22959: Show all roles in user list table
-------------------------------------+-----------------------------
Reporter: scribu | Owner: johnbillion
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.3
Component: Role/Capability | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-refresh | Focuses: administration
-------------------------------------+-----------------------------
Changes (by chriscct7):
* focuses: => administration
Comment:
I'd be happy to take this over if @johnbillion wants a rescue on this one.
I think there's a couple key questions that need to be answered on this:
- How many roles are shown by default? All of them is ideal unless you get
1 user with 50 roles and everyone else has 1. I think this would be so
edge case core wouldn't need to worry about it, and could be avoided with
a little overflow scroll thing if it gets nuts.
- How do we let plugins limit their roles from showing on this page? I
think two key ways. First a filter on what shows there, for that specific
screen. But also I think instead of doing a "public" key on add_role, do
"capability" so if current_user doesn't have that cap they can't
see/add/edit/remove the role. Then if a plugin wants to hide a cap from
everyone, they could use a capability that doesn't exist. This would let
plugins build out dynamic capabilities.
- Does the UI natively support multiple roles? I think it would make
plugins lives incredibly easy if either WordPress core natively supported
a Select2 multiselect like UI out of the box (yet another reason it'd be
cool to land #31696 in 4.3) for adding to user's roles on the edit user
page, or had a filter where plugins could flip it on. The absense of this
would be something every plugin who wanted to use this (from EDD to Woo to
bbPress to everyone using this) have to go out and implement this, and
each would have to do it individually. And it would let WordPress show
Super Administrator and Administrator on the multisite user listings page,
which would be cool.
- If WordPress starts supporting this, a user_has_role function could be
added that aliases to user_has_cap so that down the road roles could be
decoupled (in terms of not evaluating as a capability) if core wanted to.
Those are the ones I could remember at the moment.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22959#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list