you took a look at mdocs settings already, and made sure those roles are not active when viewing private posts.
Thank you for the quick response. When I look at the the Memphis options, I see only options for Editor, Author, Contributor and subscriber. but when I look at the DB for user meta table, now each user has 2 roles
a:2:{s:13:”administrator”;b:1;s:13:”bbp_keymaster”;b:1;}
a:2:{s:13:”administrator”;b:1;s:13:”bbp_moderator”;b:1;}
a:2:{s:10:”subscriber”;b:1;s:15:”bbp_participant”;b:1;}
The new roles for Forum introduced by bbpress are
1. Keymaster,
2. Moderator
3. Participant
4. Spectator.
I would like to edit the code so that any users with Main role as Editor, Author, Contributor in combination with any of the forum roles to have access to the documents.
In simpler words, I want to ignore the role returned for Forum and purely take the main site roles into consideration.
you can take a look at mdocs-rights.php line 37 is the function mdocs_check_posts_rights.
function mdocs_check_post_rights($the_mdoc) {
global $current_user;
if(empty($current_user->roles)) $current_user->roles[0] = 'none';
$hide_all_post = get_option('mdocs-hide-all-posts');
$hide_all_post_non_members = get_option('mdocs-hide-all-posts-non-members');
$mdocs_view_private = get_option('mdocs-view-private');
$post_status = get_post_status($the_mdoc['parent']);
$is_allow = false;
// ADMINS GET FULL RIGHTS FOR EVERY FILE
if(current_user_can( 'manage_options' )) $is_allowed = true;
// OWNER RIGHTS
if($current_user->user_login == $the_mdoc['owner']) $is_allowed = true;
// VIEW PRIVATE POSTS
foreach($mdocs_view_private as $index => $role) {
if(in_array($index, $current_user->roles)) { $is_allow = true; break; }
}
// PUBLIC POST ONLY
if($post_status == 'publish') {
// HIDE ALL POSTS
if($hide_all_post == false && $hide_all_post_non_members == false) $is_allow = true;
// HIDE ALL POST NON MEMBERS
if(is_user_logged_in() == true && $hide_all_post_non_members == true) $is_allow = true;
}
return $is_allow;
}