Make WordPress Core


Ignore:
Timestamp:
09/30/2025 03:49:18 PM (11 months ago)
Author:
johnbillion
Message:

REST API: Increase the specificity of capability checks for collections when the edit context is in use.

The edit access in now taken into account for each individual post, term, or user in the response.

Props andraganescu, desrosj, ehti, hurayraiit, iandunn, joehoyle, johnbillion, jorbin, mnelson4, noisysocks, peterwilsoncc, rmccue, timothyblynjacobs, vortfu, whyisjake, zieladam.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-users-controller.php

    r60251 r60814  
    13141314                $request->set_param( 'context', 'edit' );
    13151315                $response = rest_get_server()->dispatch( $request );
    1316                 $this->assertErrorResponse( 'rest_user_cannot_view', $response, 401 );
     1316                $this->assertErrorResponse( 'rest_forbidden_context', $response, 401 );
    13171317        }
    13181318
Note: See TracChangeset for help on using the changeset viewer.