Don't show "Move to Trash" link if current user cannot delete posts #23144
Labels
[Package] Editor
/packages/editor
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Describe the bug
Noticed this while working on #23119. The current component has no checks for current user's capabilities. But there are three that need to be checked:
delete_posts
,delete_others_posts
, anddelete_published_posts
.To reproduce
read
andedit_posts
capabilitiesExpected behavior
If the user has no access to delete posts the link should not be displayed.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
This probably needs a patch for core to extend the checks in
WP_REST_Posts_Controller::get_available_actions()
too.The text was updated successfully, but these errors were encountered: