- Timestamp:
- 09/30/2025 05:06:42 PM (9 months ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/rest-api/rest-users-controller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
- Property svn:mergeinfo changed
/trunk merged: 60814-60816
- Property svn:mergeinfo changed
-
branches/4.7/tests/phpunit/tests/rest-api/rest-users-controller.php
r40426 r60839 819 819 $request->set_param( 'context', 'edit' ); 820 820 $response = $this->server->dispatch( $request ); 821 $this->assertErrorResponse( 'rest_ user_cannot_view', $response, 401 );821 $this->assertErrorResponse( 'rest_forbidden_context', $response, 401 ); 822 822 } 823 823 … … 2396 2396 } 2397 2397 2398 /** 2399 * Callback for map_meta_cap filter to disallow edit_user capability 2400 * 2401 * @param array $caps Required capabilities. 2402 * @param string $cap Capability being checked. 2403 * @return array Modified capabilities. 2404 */ 2405 public function disallow_edit_user_cap( $caps, $cap ) { 2406 if ( 'edit_user' === $cap ) { 2407 return array( 'do_not_allow' ); 2408 } 2409 2410 return $caps; 2411 } 2412 2413 /** 2414 * Callback for map_meta_cap filter to allow edit_user capability 2415 * 2416 * @param array $caps Required capabilities. 2417 * @param string $cap Capability being checked. 2418 * @return array Modified capabilities. 2419 */ 2420 public function allow_edit_user_cap( $caps, $cap ) { 2421 if ( 'edit_user' === $cap ) { 2422 return array(); 2423 } 2424 2425 return $caps; 2426 } 2427 2398 2428 protected function allow_user_to_manage_multisite() { 2399 2429 wp_set_current_user( self::$user );
Note: See TracChangeset
for help on using the changeset viewer.