Level 0, BBPress, Spectate

I’d like to restrict “free” members to spectate on BB Press, but the default for s2member is spectate + participate.

I have installed Capability Manager Enhanced, and denied the following capabilities to the Level 0 role: participate, read_private_forums, publish_topics, edit_topics, publish_replies, edit_replies, assign_topic_tags

But Capability Manager Enhanced seems to be permissive and it appears these restrictions are overridden by the fact free members have the Participant forum role.

I have seen hints in older forum threads that adding code to s2-hacks.php may offer a solution, but haven’t found any real suggestions.

Ideally I’d like people joining on a free membership to be assigned the Spectator forum role, and not Participator.

Has anyone any suggestions?

Many thanks!

In case this is useful to anyone else that might want to make bbpress forums read only to level0 members, here’s what I’ve done … in s2-hacks.php:

add_action('ws_plugin__s2member_after_security_gate', 'my_custom_security_gate');
function my_custom_security_gate() {
    if(!current_user_can('access_s2member_level1') && current_user_can('bbp_participant')) {
        $user = wp_get_current_user();
        $new_role_forum_role="bbp_spectator";
        bbp_set_user_role($user->ID, $new_role_forum_role);
    }
}
1 Like