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() {
389
389
$ id = $ _GET ['id ' ];
390
390
check_admin_referer ( 'rest-oauth1-delete: ' . $ id );
391
391
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
+
392
400
$ client = WP_REST_OAuth1_Client::get ( $ id );
393
401
if ( is_wp_error ( $ client ) ) {
394
402
wp_die ( $ client );
@@ -413,6 +421,14 @@ public static function handle_regenerate() {
413
421
$ id = $ _GET ['id ' ];
414
422
check_admin_referer ( 'rest-oauth1-regenerate: ' . $ id );
415
423
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
+
416
432
$ client = WP_REST_OAuth1_Client::get ( $ id );
417
433
$ client ->regenerate_secret ();
418
434
You can’t perform that action at this time.
0 commit comments