[wp-trac] [WordPress Trac] #52043: Post type listings in submenus require parent menu capability
WordPress Trac
noreply at wordpress.org
Sat Dec 12 09:31:26 UTC 2020
#52043: Post type listings in submenus require parent menu capability
----------------------------+-----------------------------
Reporter: manfcarlo | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
If a post type is registered under a submenu, such as
`$args['show_in_menu'] = 'options-general.php'` or `$args['show_in_menu']
= 'themes.php'`, viewing the post type listing seems to require the
capability to access the parent page.
If a user lacks the capability for the parent page but does have the
capability to edit the post type, the post type appears in the admin menu,
but returns a 403 error when navigated to.
This makes no sense because the user actually does have the capability to
access that page, and it's an independent page with its own capabilities.
Note that even the parent menu link will be modified to point to the post
type listing, rather than the normal parent page that they genuinely lack
the capability for.
There appears to be handling for this equivalent scenario for options
pages, but not for post type listings.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52043>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list