@since: bbPress (r4363)

This is necessary because in a few places (noted below) WordPress initializes a blog’s roles directly from the database option. When this happens, the $wp_roles global gets flushed, causing a user to magically lose any dynamically assigned roles or capabilities when $current_user in refreshed.

Source: bp-forums/core/capabilities.php:359


Helper function to add filter to option_wp_user_roles

Source: bp-forums/core/capabilities.php:328