| 4427 | | if ( isset($content_struct['wp_author_id']) && ($user->ID != $content_struct['wp_author_id']) ) { |
| 4428 | | switch ( $post_type ) { |
| 4429 | | case 'post': |
| 4430 | | if ( !current_user_can('edit_others_posts') ) |
| 4431 | | return(new IXR_Error(401, __('You are not allowed to change the post author as this user.'))); |
| 4432 | | break; |
| 4433 | | case 'page': |
| 4434 | | if ( !current_user_can('edit_others_pages') ) |
| 4435 | | return(new IXR_Error(401, __('You are not allowed to change the page author as this user.'))); |
| 4436 | | break; |
| 4437 | | default: |
| 4438 | | return(new IXR_Error(401, __('Invalid post type'))); |
| 4439 | | break; |
| | 4427 | if ( isset($content_struct['wp_author_id']) ) { |
| | 4428 | // Check permissions if attempting to switch author to or from another user |
| | 4429 | if ( ( $user->ID != $content_struct['wp_author_id'] ) || ( $user->ID != $post_author) ) { |
| | 4430 | switch ( $post_type ) { |
| | 4431 | case 'post': |
| | 4432 | if ( !current_user_can('edit_others_posts') ) |
| | 4433 | return(new IXR_Error(401, __('You are not allowed to change the post author as this user.'))); |
| | 4434 | break; |
| | 4435 | case 'page': |
| | 4436 | if ( !current_user_can('edit_others_pages') ) |
| | 4437 | return(new IXR_Error(401, __('You are not allowed to change the page author as this user.'))); |
| | 4438 | break; |
| | 4439 | default: |
| | 4440 | return(new IXR_Error(401, __('Invalid post type'))); |
| | 4441 | break; |
| | 4442 | } |