This can be achieved by some coding. If it is okay to make a custom module then it can be done via hook_form_alter(&$form, &$form_state, $form_id)
In this hook get a debug statement to get the form id for your node edit page. Now in that page you need to get the type of node being edited. So there are 3 things to look for.
- Get the form_id for the node edit page. Then use this in a switch-case statement to perform your logic.
- Then get the Node type that is being edited, from the URL. So if you are in a edit page then the URL will be like, http://example.com/node/14/edit. For arg(2) you will get the node id. Perform a node_load and call node_type_get_name($node) or just a simple database query to node table by node id will do it for you.
- Check for the User role and decide to show/hide the select box.
function mymodule_form_alter(&$form, &$form_state, $form_id) {
global $user;
switch($form_id) {
case "node-edit_form" : //may differ as I am only giving a demo
//Add your logic
$nid = arg(2); //Add some isset check will be good and filter_xss() for security purpose.
$node_type = db_select('node', 'n')->fields('n', array('type'))->condition('nid', $nid, '=')->execute()->fetchObject();
if($node_type->type == 'your_needed_type') {
if(array_key_exists('company manager', $user->roles)) {
$form['#after_build'][] = 'mymodule_your_needed_type_node_form_after_build';
}
}
break;
}
}
function mymodule_your_needed_type_node_form_after_build($form) {
// We want this on a specific field
$form[LANGUAGE_NONE]['0']['format']['#access'] = FALSE;
return $form;
}
I think this will solve the issue for you. You can do some R&D and make it more efficient like to add more checks.
node_edit
of their company(node)"?