Closed whitecoop closed 7 years ago
You probably want to use Groups_Post_Access_Legacy::user_can_read_post() instead if you are checking based on capabilities, with the changes in 2.x the method will test based on group restrictions so you'll have to use the legacy class instead.
I think this function is wrong: admin override should not be done, if it is called with an user id.
// admin override and Groups admins see everything if ( _groups_admin_override() || ($user_id == get_current_user_id() && current_user_can( GROUPS_ADMINISTER_GROUPS )) ) {
The newsletter plugin sends out notification emails, when a post is published. this function cannot be used there if an admin edits the posts - everybody will get the mail, as this function returns true for the admin evey time, no matter what userId you pass to the method
I recently updated our site to 2.x and
Groups_Post_Access::user_can_read_post()
method now returns true for posts that users shouldn't be able to view.Is this expected behavior?