If this helps anyone else looking for this, I used the code below:
/**disable the BP Activity share for all except admin**/
add_action('admin_init', 'my_filter_the_plugins');
function my_filter_the_plugins()
{
global $current_user;
if ( in_array('participant', $current_user->roles) || in_array('subscriber',
$current_user->roles) ) {
deactivate_plugins( // deactivate for participant and subscriber
array(
'/bp-activity-share/bp-activity-share.php'
),
true // silent mode (no activation hooks fired)
);
} else { // activate for those than can use it
activate_plugins(
array(
'/bp-activity-share/bp-activity-share.php'
),
'', // redirect url, does not matter (default is '')
false // network wide)
);
}
}