[wp-trac] [WordPress Trac] #38130: Multisite bug with current_user_can() and subscriber

WordPress Trac noreply at wordpress.org
Thu Sep 22 15:17:52 UTC 2016


#38130: Multisite bug with current_user_can() and subscriber
--------------------------+-----------------------------
 Reporter:  JazZ7         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.6.1
 Severity:  normal        |   Keywords:
  Focuses:  multisite     |
--------------------------+-----------------------------
 On multisite, Subscribers have `upload_files` permission but in wp-
 admin/includes/ajax-actions.php `wp_ajax_upload_attachment()` does not
 work because `current_user_can()` return `false` on line 2018 :

 {{{#!php
 <?php
     if ( ! current_user_can( 'upload_files' ) ) {
         echo wp_json_encode( array(
             'success' => false,
             'data'    => array(
                 'message'  => __( 'Sorry, you are not allowed to upload
 files.' ),
                 'filename' => $_FILES['async-upload']['name'],
             )
         ) );

         wp_die();
     }
 }}}

 Thanks for your help.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38130>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list