<commit_before><?php

function Users_after_Q_responseExtras() {
	if ($preloaded = Users_User::$preloaded) {
		Q_Response::setScriptData(
			'Q.plugins.Users.User.preloaded',
			Db::exportArray($preloaded, array('asAvatar' => true))
		);
	}
	Q_Response::setScriptData('Q.plugins.Users.roles', Users::roles());
	$user = Users::loggedInUser(false, false);
	Q_Response::addHtmlCssClass($user ? 'Users_loggedIn' : 'Users_loggedOut');
}
<commit_msg>Set Q.plugins.Users.roles object label by label instead rewrite whole object.<commit_after><?php

function Users_after_Q_responseExtras() {
	if ($preloaded = Users_User::$preloaded) {
		Q_Response::setScriptData(
			'Q.plugins.Users.User.preloaded',
			Db::exportArray($preloaded, array('asAvatar' => true))
		);
	}
	$roles = Users::roles();
	foreach ($roles as $label => $role) {
		Q_Response::setScriptData('Q.plugins.Users.roles.'.$label, $role);
	}
	$user = Users::loggedInUser(false, false);
	Q_Response::addHtmlCssClass($user ? 'Users_loggedIn' : 'Users_loggedOut');
}

{'fraction_non_alphanumeric': 0.17092337917485265, 'fraction_numerical': 0.0, 'mean_word_length': 6.548148148148148, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2369414', 'n_tokens_mistral': 378, 'n_tokens_neox': 375, 'n_words': 54}