Skip to content

Commit

Permalink
Users: Make sure authors can read their own event.
Browse files Browse the repository at this point in the history
See #5.
  • Loading branch information
r-a-y committed May 10, 2015
1 parent 19123aa commit 65d69af
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions includes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,14 @@ function bpeo_map_basic_meta_caps( $caps, $cap, $user_id, $args ) {
case 'read_event' :
if ( get_post( $args[0] )->post_status === 'publish' ) {
return array( 'exist' );
} else {
return $caps;
}

// Make sure authors can view their own post
if ( get_post( $args[0] )->post_author === $user_id ) {
return array( 'exist' );
}

return $caps;
break;

default :
Expand Down

0 comments on commit 65d69af

Please sign in to comment.