File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -389,6 +389,14 @@ public static function handle_delete() {
389389 $ id = $ _GET ['id ' ];
390390 check_admin_referer ( 'rest-oauth1-delete: ' . $ id );
391391
392+ if ( ! current_user_can ( 'delete_post ' , $ id ) ) {
393+ wp_die (
394+ '<h1> ' . __ ( 'Cheatin’ uh? ' ) . '</h1> ' .
395+ '<p> ' . __ ( 'You are not allowed to delete this application. ' ) . '</p> ' ,
396+ 403
397+ );
398+ }
399+
392400 $ client = WP_REST_OAuth1_Client::get ( $ id );
393401 if ( is_wp_error ( $ client ) ) {
394402 wp_die ( $ client );
@@ -413,6 +421,14 @@ public static function handle_regenerate() {
413421 $ id = $ _GET ['id ' ];
414422 check_admin_referer ( 'rest-oauth1-regenerate: ' . $ id );
415423
424+ if ( ! current_user_can ( 'edit_post ' , $ id ) ) {
425+ wp_die (
426+ '<h1> ' . __ ( 'Cheatin’ uh? ' ) . '</h1> ' .
427+ '<p> ' . __ ( 'You are not allowed to edit this application. ' ) . '</p> ' ,
428+ 403
429+ );
430+ }
431+
416432 $ client = WP_REST_OAuth1_Client::get ( $ id );
417433 $ client ->regenerate_secret ();
418434
You can’t perform that action at this time.
0 commit comments