I’ve found a way around the problem. It’s not a “fix”, but rather a way to get around the problem of needing synchronized user roles. Instead of trying to make all user roles match up, I decided to only check the user roles for the main site. see my function below for how I did it:
/*
* Function to check a specified user from a subsite against
* the role of that same user on the main site
*
* @param int $site_to_check the id of the site to check the user's role from
* @param int $user_id the user's id to check
*/
function cgc_check_for_citizen($site_to_check = 1, $user_id = null) {
if(!isset($user_id)) {
return false;
}
$citizen = false;
global $blog_id;
if($blog_id == 1) { // we're on the main site
if(user_can($user_id, 'read_citizen')) {
$citizen = true;
}
} else {
switch_to_blog($site_to_check);
if(user_can($user_id, 'read_citizen')) {
$citizen = true;
}
restore_current_blog();
}
return $citizen;
}