Skip to content

Commit dffdc28

Browse files
chriszaratechriszarateingeniumed
authored andcommitted
RTC: Add cap check for single taxonomy term entities (#75708)
Co-authored-by: chriszarate <czarate@git.wordpress.org> Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org>
1 parent 1112080 commit dffdc28

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

backport-changelog/7.0/10894.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ https://github.com/WordPress/wordpress-develop/pull/10894
33
* https://github.com/WordPress/gutenberg/pull/75366
44
* https://github.com/WordPress/gutenberg/pull/75681
55
* https://github.com/WordPress/gutenberg/pull/75682
6+
* https://github.com/WordPress/gutenberg/pull/75708

lib/compat/wordpress-7.0/class-wp-http-polling-sync-server.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,12 @@ private function can_user_sync_entity_type( string $entity_kind, string $entity_
275275
return current_user_can( 'edit_post', absint( $object_id ) );
276276
}
277277

278+
// Handle single taxonomy term entities with a defined object ID.
279+
if ( 'taxonomy' === $entity_kind && is_numeric( $object_id ) ) {
280+
$taxonomy = get_taxonomy( $entity_name );
281+
return isset( $taxonomy->cap->assign_terms ) && current_user_can( $taxonomy->cap->assign_terms );
282+
}
283+
278284
// All of the remaining checks are for collections. If an object ID is
279285
// provided, reject the request.
280286
if ( null !== $object_id ) {

0 commit comments

Comments
 (0)