Make WordPress Core

Opened 14 years ago

Closed 9 years ago

Last modified 9 years ago

#16719 closed defect (bug) (fixed)

Remove vestige add_users capability

Reported by: nacin's profile nacin Owned by: dd32's profile dd32
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Role/Capability Keywords: has-patch commit
Focuses: Cc:

Description

Listed in populate_roles_300() and added in [14174], it was never used. The situation it was presumably introduced for now falls on promote_users.

Attachments (4)

patch16719.diff (483 bytes) - added by renoirb 13 years ago.
Remove legacy hook as per proposed
16719-1.patch (986 bytes) - added by Craig Ralston 9 years ago.
16719-2.patch (1012 bytes) - added by Craig Ralston 9 years ago.
16179.diff (928 bytes) - added by boonebgorges 9 years ago.

Download all attachments as: .zip

Change History (22)

@renoirb
13 years ago

Remove legacy hook as per proposed

#1 @nacin
12 years ago

  • Keywords has-patch added
  • Milestone changed from Future Release to 3.5

Wondering whether we should go through the trouble of also removing it in an upgrade routine.

#2 @markjaquith
12 years ago

Four plugins in the repo are using it. Should we yank the actual cap and then map it to promote_users? Either way, I'm thinking that the actual cap should be removed from any roles that have it.

#3 @nacin
12 years ago

Either way, I'm thinking that the actual cap should be removed from any roles that have it.

Seems fine to me. We can use map_meta_cap to map it to promote_users. Opens us up to adding it in the future.

#4 @nacin
12 years ago

In [22300]:

Comment that the add_users capability was never used and has its days numbered. see #16719.

#5 @nacin
12 years ago

  • Milestone changed from 3.5 to Future Release

Per scrub.

#6 @chriscct7
10 years ago

  • Keywords needs-patch good-first-bug added; 3.2-early has-patch removed

Needs patch that removes cap from users and map_meta_cap's the cap as described in comment:2

#7 @Craig Ralston
9 years ago

  • Keywords has-patch added; needs-patch removed

16719-1.patch removes add_users legacy cap and maps it to promote_users

Last edited 9 years ago by Craig Ralston (previous) (diff)

#8 @DBrumbaugh10Up
9 years ago

I think I would like to work on this, I'll take a look at it.

#9 @wonderboymusic
9 years ago

  • Keywords needs-refresh added
  • Milestone changed from Future Release to 4.4

#10 @Craig Ralston
9 years ago

  • Keywords needs-refresh removed

16719-2.patch refreshes 16719-1.patch

#11 @wonderboymusic
9 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 35507:

Roles: map add_users cap to promote_users and remove it.

"Never used, will be removed." - The Ghost of 3.5 Nacin

Props Craig Ralston, renoirb.
Fixes #16719.

#12 @nacin
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

It seemed like 3 years ago, @markjaquith and I agreed:

Wondering whether we should go through the trouble of also removing it in an upgrade routine.

I'm thinking that the actual cap should be removed from any roles that have it.

An upgrade routine seems prudent. Please re-close if you disagree.

#13 @wonderboymusic
9 years ago

  • Owner changed from wonderboymusic to dd32
  • Status changed from reopened to assigned

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


9 years ago

@boonebgorges
9 years ago

#15 @boonebgorges
9 years ago

  • Keywords good-first-bug removed

16179.diff introduces the migration routine suggested above.

#16 @dd32
9 years ago

  • Keywords commit added

Noting that I've reviewed the patch, and it looks good to me (assuming it works ;) )

#17 @boonebgorges
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 35701:

On 4.4 upgrade, remove the unused 'add_users' cap from all roles.

Fixes #16719.

#18 @havahula
9 years ago

Not sure if this is the right place but it would be good to update the codex on this one:
https://codex.wordpress.org/Roles_and_Capabilities#add_users

Note: See TracTickets for help on using tickets.