Make WordPress Core

Opened 5 years ago

Last modified 4 years ago

#9378 new enhancement

Deprecate manage_category cap in favor of its object type's cap

Reported by: mastermind Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.7.1
Component: Taxonomy Keywords: needs-patch
Focuses: Cc:


I encountered a problem in WordPress 2.7.1 $wp_roles->remove_cap('editor', 'manage_links'); doesn't remove that capability for the Editor role entirely, but it still displays the page "link categories", and you can perform actions on that page. This is because that page needs "manage_categories" instead of "manage_links".

I would propose to either require the manage_links capability for this page, or introduce a new capability (something as manage_link_categories for example).

Attachments (1)

9378.diff (840 bytes) - added by Denis-de-Bernardy 5 years ago.
against r11256

Download all attachments as: .zip

Change History (7)

comment:1 Denis-de-Bernardy5 years ago

  • Keywords has-patch 2nd-opinion added
  • Milestone changed from Unassigned to 2.8

Patch attached, but I'm itching between suggesting that this should also be the case for post categories and tags, for the sake of consistency, or suggesting that what's really needed is a different manage_* capacity for each taxonomy...

comment:2 Denis-de-Bernardy5 years ago

  • Keywords dev-feedback added

comment:3 Denis-de-Bernardy5 years ago

  • Keywords tested commit added

commit? wontfix?

Denis-de-Bernardy5 years ago

against r11256

comment:4 westi5 years ago

  • Keywords needs-patch added; has-patch tested commit 2nd-opinion dev-feedback removed
  • Milestone changed from 2.8 to 2.9

Just changing it in the menu won't help here.

As if I still have the manage_categories cap then I can go to the page by url and change things there as that checks that cap.

Moving to 2.9 for now.

We need to decide if we can have per-taxonomy caps to provide better flexibility here.

comment:5 Denis-de-Bernardy5 years ago

  • Component changed from Administration to Taxonomy
  • Milestone changed from 2.9 to Future Release
  • Summary changed from Removing cap 'manage_links' doesn't remove all link related capabilities to Deprecate manage_category cap in favor of its object type's cap
  • Type changed from defect (bug) to enhancement

Suggesting the following instead:

We deprecate the manage_category cap. For each taxonomy, we look at the applicable object type instead.

If use can edit that object type, he can edit the taxonomy.

comment:6 kevinB4 years ago

  • Cc kevinB added
Note: See TracTickets for help on using tickets.