Add edit_page cap check. Props josephscott. see #5313

git-svn-id: https://develop.svn.wordpress.org/trunk@6709 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-02-02 17:55:40 +00:00
parent d2067ba297
commit bc75594504
1 changed files with 4 additions and 1 deletions

View File

@ -1379,10 +1379,13 @@ class wp_xmlrpc_server extends IXR_Server {
!empty($content_struct["post_type"])
&& ($content_struct["post_type"] == "page")
) {
if( !current_user_can( 'edit_page', $post_ID ) ) {
return(new IXR_Error(401, __("Sorry, you do not have the right to edit this page.")));
}
$post_type = "page";
}
// Edit page caps are checked in editPage. Just check post here.
if ( ( 'post' == $post_type ) && !current_user_can('edit_post', $post_ID) )
return new IXR_Error(401, __('Sorry, you can not edit this post.'));