cuny-academic-commons / bp-event-organiser

Allows Event Organiser plugin events to be assigned to BuddyPress groups and generates a group calendar page for each group
GNU General Public License v2.0
3 stars 1 forks source link

Groups: Give members read access to private events that they are a member of #63

Closed r-a-y closed 6 years ago

r-a-y commented 6 years ago

A user reported an issue with events created in private groups.

If a group member creates an event in a private group, other members of that group cannot view the event on the group event calendar.

The issue is due to the event being created with the private post status and WordPress doing a check on the read_private_events cap when our AJAX query runs to display events on the group calendar.

The interesting thing is the "Events > Upcoming" page does not require the read_private_posts cap check as we use eo_get_events() to grab the events and not the WP query loop.

The approach I've used in the PR is similar to what we do with the read_group_events cap check. I'm basically duplicating portions of that code to appease WordPress here.

Could use your feedback here, @boonebgorges