Index: wp-admin/includes/post.php
===================================================================
--- wp-admin/includes/post.php	(revision 13607)
+++ wp-admin/includes/post.php	(working copy)
@@ -482,9 +482,10 @@
 function wp_write_post() {
 	global $user_ID;
 
-	if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {
-		if ( !current_user_can( 'edit_pages' ) )
-			return new WP_Error( 'edit_pages', __( 'You are not allowed to create pages on this blog.' ) );
+	if ( isset( $_POST['post_type'] ) ) {
+		$post_type_obj = get_post_type_object($_POST['post_type']);
+		if ( !current_user_can($post_type_obj->edit_type_cap) )
+			return new WP_Error( $post_type_obj->edit_type_cap, sprintf(__( 'You are not allowed to create %s on this blog.'), $post_type_obj->label) );
 	} else {
 		if ( !current_user_can( 'edit_posts' ) )
 			return new WP_Error( 'edit_posts', __( 'You are not allowed to create posts or drafts on this blog.' ) );
