# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\xampp\htdocs\wordtrunk\wp-includes
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: class-wp-xmlrpc-server.php
--- class-wp-xmlrpc-server.php Base (BASE)
+++ class-wp-xmlrpc-server.php Locally Modified (Based On LOCAL)
@@ -3855,13 +3855,13 @@
 		if ( ! $postdata || empty( $postdata[ 'ID' ] ) )
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
 
-		if ( ! current_user_can( 'edit_post', $post_ID ) )
-			return new IXR_Error( 401, __( 'Sorry, you do not have the right to edit this post.' ) );
-
 		// Use wp.editPost to edit post types other than post and page.
 		if ( ! in_array( $postdata[ 'post_type' ], array( 'post', 'page' ) ) )
 			return new IXR_Error( 401, __( 'Invalid post type.' ) );
 
+                if ( ! current_user_can( "edit_{$postdata[ 'post_type' ]}", $post_ID ) )
+			return new IXR_Error( 401, __( "Sorry, you do not have the right to edit this {$post_type}." ) );
+
 		// Thwart attempt to change the post type.
 		if ( ! empty( $content_struct[ 'post_type' ] ) && ( $content_struct['post_type'] != $postdata[ 'post_type' ] ) )
 			return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
@@ -4014,11 +4014,10 @@
 
 		$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;
 
-		if ( ('publish' == $post_status) ) {
-			if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') )
-				return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.'));
-			else if ( !current_user_can('publish_posts') )
-				return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
+		if ( ('publish' == $post_status) || ('private' == $post_status) ) {
+                        if ( ! current_user_can( "publish_{$post_type}", $post_ID ) )
+                                return new IXR_Error( 401, __( "Sorry, you do not have the right to publish this {$post_type}." ) );
+
 		}
 
 		if ( $post_more )
