Make WordPress Core


Ignore:
Timestamp:
09/30/2025 04:50:20 PM (12 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.

Merges [60814] into the 6.8 branch.

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

Location:
branches/6.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.8

  • branches/6.8/tests/phpunit/tests/rest-api/rest-users-controller.php

    r60143 r60817  
    13121312                $request->set_param( 'context', 'edit' );
    13131313                $response = rest_get_server()->dispatch( $request );
    1314                 $this->assertErrorResponse( 'rest_user_cannot_view', $response, 401 );
     1314                $this->assertErrorResponse( 'rest_forbidden_context', $response, 401 );
    13151315        }
    13161316
Note: See TracChangeset for help on using the changeset viewer.