Opened 3 years ago

Last modified 11 months ago

#13972 new defect (bug)

Add new category link - capability check needed

Reported by: wjm Owned by:
Priority: normal Milestone: Future Release
Component: Administration Version: 3.0
Severity: minor Keywords: has-patch needs-testing
Cc: wojtek.szkutnik@…, azizur, bpetty

Description

/wp-admin/link-add.php

If user doesn´t have "manage_categories" capability, add new link page, will show "add new category" link and form,
it should be hidden.

Attachments (3)

add_new_link_category.patch (590 bytes) - added by wjm 3 years ago.
13972.diff (2.3 KB) - added by wojtek.szkutnik 3 years ago.
13972-2.patch (2.2 KB) - added by bpetty 11 months ago.

Download all attachments as: .zip

Change History (10)

wjm3 years ago

  • Keywords needs-patch added
  • Milestone changed from Unassigned to Future Release

We should probably use the taxonomy API here and utilize the caps object.

  • Cc wojtek.szkutnik@… added
  • Keywords has-patch needs-testing gsoc added; needs-patch removed

Does this patch do the job? I was wondering whether it should be assign_terms or edit_terms?

OK, this one should work.

  • Cc azizur added
  • Cc bpetty added
  • Keywords gsoc removed

Previous patch used the wrong taxonomy (needed to be "link_category"), and also used the wrong capability terms (used edit_terms and assign_terms when it needed to only be manage_terms for adding new link categories).

Also, patches should be built with directory context, not from single files, and since this the old patch didn't apply cleanly anyway, I've refreshed that as well.

Guess I should also note that this bug is only a problem for anyone using custom capability plugins to modify or add new roles that have the manage_links capability, but *not* the manage_categories capability. The default roles are not configured like this.

I installed and used the popular Capability Manager plugin to do this and test with.

Note: See TracTickets for help on using tickets.