#62737 closed defect (bug) (reported-upstream)
Block editor Author list missing capability check
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.9 |
Component: | Editor | Keywords: | has-testing-info has-screenshots has-patch |
Focuses: | administration, rest-api | Cc: |
Description
Hello
The author dropdown in page settings is not working correctly in block editor. It doesn't check user capabilities.
Here is the steps to replicate
- Install a fresh WP
- Create a contributor user so you will have 2 user 1 admin and 1 contributor
- Create a page in Classic Editor
- You will see it is showing only admin user in Author change dropdown because contributor doesn't have edit_pages capability
- Create a page in Block Editor
- Go to author change dropdown, you will see contributor user as well.
Which looks a bug to me. We need to make sure that there is a capability check.
Screenshots;
Classic Editor:
https://share.cleanshot.com/69vlJWcH
Block Editor:
https://share.cleanshot.com/xyVlryhh
Change History (8)
This ticket was mentioned in PR #8043 on WordPress/wordpress-develop by @dilipbheda.
4 months ago
#2
- Keywords has-patch added
#3
@
4 months ago
@cagdasdag Thanks for the report.
I've fixed the issue in the attached PR.
@sukhendu2002 Could you test it and share the report?
Thanks!
@cagdasdag commented on PR #8043:
4 months ago
#5
I don't think the fix is correct. In classic editor we have post_type_object->cap->edit_posts check. So we should use same capability check for consistency.
#6
@
4 months ago
- Component changed from General to Editor
- Milestone Awaiting Review deleted
- Resolution set to reported-upstream
- Status changed from new to closed
This needs to be fixed on the Gutenberg side, where they need to use the capability
argument instead of the who
argument (which uses a deprecated query arg under the hood). who
should be maintained as-is for backward compatibility.
This has been reported at https://github.com/WordPress/gutenberg/issues/39986 before, so I recommend chiming in there to fix it in the block editor.
@swissspidy commented on PR #8043:
4 months ago
#8
As per the ticket, this should be fixed in Gutenberg at https://github.com/WordPress/gutenberg/issues/39986
Reproduction Report
Description
This report validates whether the issue can be reproduced.
Environment
Actual Results
Supplemental Artifacts
Block Editor
Classic Editor