I have custom module code that check the user role and based on user role, user fields updated,
for example
if(array_key_exists(12,$user->roles)) {
//Manger
$role = array(8=>8);
} elseif (array_key_exists(13,$user->roles) ) {
// super Manger
$role = array(14=>14);
} elseif (array_key_exists(11,$user->roles)) {
//section manager
$role = array(14=>14,8=>8);
}
so when I want to move this module to other site and import roles using feature, the ids will changed.
so how can I use machine name for roles instead of ids.
Regard,