I want to change or disable some fields depending on role So i found that code which i use in vardef of module . I have dropdown list YES or NO which i would like to appear as textfield for some roles and higher roles to be able to edit that field

Could you please give me the code example how to convert dropdown view to non editable text?

$role_to_check = "Team Manager"; // change this to the name of the role that you want to do a check on

global $current_user; // grab the $current_user object
require_once("modules/ACLRoles/ACLRole.php");
$acl_role_obj = new ACLRole();

$user_roles = $acl_role_obj->getUserRoles($current_user->id); // grab a list of the current user's roles

$user_in_role = FALSE;
foreach ($user_roles as $role) {
if ($role->name == $role_to_check) { // is the user in the role we're trying to restrict?
$user_in_role = TRUE;
break;
}
}

If the user is in the role, display the Manager view dropdown.

Here, we’re over riding the OPTIONS_ROLE_SELECT_C.

Notice how we’re now referencing the role_select_c variable that we added to Lead.php

if ($user_in_role) {
$xtpl->assign("OPTIONS_ROLE_SELECT_C",get_select_options _with_id($app_list_strings['manager_role_select_dom'],
$focus->role_select_c));

}else{
//User is not in role, display the regular / default values

$xtpl->assign("OPTIONS_ROLE_SELECT_C",get_select_options _with_id($app_list_strings['regular_role_select_dom'],
$focus->role_select_c));
}