WordPress have multiple user roles one of the popular user role is “Contributor” role. By default WordPress does not allow accounts with contributor role to upload images inside their written articles. So if you want to allow them to do this then you can achieve this by adding this snippet.

This code snippets allows users with contributor role to upload images inside the articles written by them. To achieve this you have to add following lines of code inside your active theme’s functions.php file.

if ( current_user_can('contributor') && !current_user_can('upload_files') )
     add_action('admin_init', 'allow_contributor_uploads');      
     function allow_contributor_uploads() {
          $contributor = get_role('contributor');
          $contributor->add_cap('upload_files');
}