Disable default posts (Posts,Pages,Comments and Media) in wp-admin

Add this to your functions.php file, and note that you’ll need to grab and edit the capabilities for each post type (Post, Page and Attachment) and taxonomy (Category and Post Tag).

You should note that there are more capabilities than those listed, but I don’t believe that the need changing. Therefore I advise you to output the default capabilites for each post type and work out exactly which ones you need to change, and what they should be changed to.

I haven’t looked to much in to exactly what permission you would need to set, but I believe that this example will make it so that only Editors and above can do anything with Posts.

For more information on Roles and Capabilities, check out the Codex.

add_action('init', 'my_change_post_object_cap', 1);
function my_change_post_object_cap(){

    $post = get_post_type_object('post');
    $post_cap = &$post->cap;

    $post_cap->edit_post="edit_others_posts";
    $post_cap->read_post="edit_others_posts";
    $post_cap->delete_post="delete_others_posts";
    $post_cap->edit_posts="edit_others_posts";
    $post_cap->edit_others_posts="edit_others_posts";
    $post_cap->publish_posts="edit_others_posts";
    $post_cap->read                         = 'edit_others_posts';
    $post_cap->delete_posts="delete_others_posts";
    $post_cap->delete_published_posts="delete_others_posts";
    $post_cap->edit_published_posts="edit_others_posts";
    $post_cap->create_posts="edit_others_posts";

    $page = get_post_type_object('page');
    $page_cap = &$page->cap;
    /** do the same as above, but for pages capabilities */

    $attachment = get_post_type_object('attachment');
    $attachment_cap = &$attachment->cap;
    /** do the same as above, but for attachment capabilities */

    $category = get_taxonomy('category');
    $category_cap = $category->cap;
    /** do the same as above, but for category capabilities */

    $post_tag = get_taxonomy('post_tag');
    $post_tag_cap = $post_tag->cap;
    /** do the same as above, but for post_tag capabilities */

}