heavenbr / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
0 stars 0 forks source link

Make it so non-admin users can only view their own images and/or posts #558

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have made the backend for adding images to an image field only display images 
uploaded by the user by:
copying the _image.php file in 
wp-content/plugins/custom-content-type-manager/config/post_selector/ 
and putting it in uploads/cctm/config/post_selector/

Then I have added:

// if user not admin display only own posts
    if ( !current_user_can( 'manage_options' ) ){
          $current_user = wp_get_current_user();
          CCTM::$post_selector['author'] =  $current_user->display_name ;
}

Haven't looked for doing the same for posts, but imagine it would be the same.

Would be useful if this could be integrated into the GUI for custom fields with 
a dropdown to allow either admin, or editor to view all posts/media and any 
lower roles to only view their own

Original issue reported on code.google.com by simonjpa...@gmail.com on 27 May 2014 at 2:59

GoogleCodeExporter commented 8 years ago
https://github.com/craftsmancoding/custom-content-type-manager/issues/22

Original comment by ever...@fireproofsocks.com on 11 May 2015 at 5:29