If you want to disable new user registrations on your bbPress forums, use the following code snippet:
function disable_bbpress_registration() {
if ( is_bbpress() && !is_user_logged_in() ) {
wp_redirect( home_url() );
exit;
}
}
add_action( 'template_redirect', 'disable_bbpress_registration' );
This prevents unauthenticated users from registering or accessing your forums.