Skip to content

Commit bf13bab

Browse files
Merge pull request #1140 from cloudinary/improve/cloudinary-down-sync-hook
Improve down_sync_asset hook
2 parents 7ee0f40 + b14333a commit bf13bab

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

php/class-media.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,8 +2285,7 @@ function ( $value, $key ) use ( &$asset ) {
22852285
*/
22862286
public function down_sync_asset() {
22872287
$nonce = Utils::get_sanitized_text( 'nonce', INPUT_POST );
2288-
if ( wp_verify_nonce( $nonce, 'wp_rest' ) ) {
2289-
2288+
if ( is_user_logged_in() && wp_verify_nonce( $nonce, 'wp_rest' ) && current_user_can( 'upload_files' ) ) {
22902289
$asset = $this->get_asset_payload();
22912290
// Set a base array for pulling an asset if needed.
22922291
$base_return = array(

0 commit comments

Comments
 (0)