Changeset 3297
- Timestamp:
- 12/13/05 00:54:52 (3 years ago)
- Files:
-
- trunk/wp-includes/capabilities.php (modified) (1 diff)
- trunk/wp-includes/classes.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-includes/capabilities.php
r3296 r3297 270 270 } 271 271 break; 272 case 'read_post': 273 $post = get_post($args[0]); 274 275 if ( 'private' != $post->post_status ) { 276 $caps[] = 'read'; 277 break; 278 } 279 280 $author_data = get_userdata($user_id); 281 $post_author_data = get_userdata($post->post_author); 282 if ($user_id == $post_author_data->ID) 283 $caps[] = 'read'; 284 else 285 $caps[] = 'read_private_posts'; 286 break; 272 287 default: 273 288 // If no meta caps match, return the original cap. trunk/wp-includes/classes.php
r3293 r3297 644 644 $this->is_preview = true; 645 645 } 646 } else if ('private' == $status){647 if ( $this->posts[0]->post_author != $user_ID)646 } else { 647 if (! current_user_can('read_post', $this->posts[0]->ID)) 648 648 $this->posts = array(); 649 649 }
