Make WordPress Core

Opened 3 years ago

Closed 3 weeks ago

#20745 closed defect (bug) (worksforme)

Hard-code less capability types

Reported by: Viper007Bond Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Role/Capability Keywords: has-patch close
Focuses: Cc:


We still hard-code some capability types thoughout the admin area.

For example edit_post is hard-coded as the edit attachment capability in the edit attachment pages. It should be pulled from the post type object instead so that it can be modified.

I've patched the ones I found.

Attachments (1)

20745.patch (6.8 KB) - added by Viper007Bond 3 years ago.

Download all attachments as: .zip

Change History (7)

@Viper007Bond3 years ago

comment:1 @scribu3 years ago

'edit_post' is a meta capability. In other words, the conversion you made in your patch are already done in map_meta_cap(). Same for 'delete_post' etc.

Version 0, edited 3 years ago by scribu (next)

comment:2 @nacin3 years ago

Had we done meta capabilities with the rest of custom post types in 3.0, I don't think edit_post, read_post, or delete_post would have made it into the $cap object.

comment:3 @nacin3 years ago

  • Version changed from 3.4 to 3.0

comment:4 @chriscct75 months ago

  • Keywords close added

Because of meta caps I'm not sure if there's anything here to solve

comment:5 @wonderboymusic3 weeks ago

@Viper007Bond - what is your current state of mind here?

comment:6 @Viper007Bond3 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

I can't remember what I was originally on about. I likely didn't understand meta caps and I'm not sure I still fully do, but that's okay. Going to close.

Note: See TracTickets for help on using tickets.