How do I use an access callback to limit the access basing on the user role?
For example, in my site I have the following roles:
- Administrator
- Authenticate User
- Anonymous user
- Teacher
I want to make a particular page available only to the users who have the Teacher role. How can I achieve this?
function form_test_menu() {
$items['programme_reg'] = array(
'title' => 'Approved Programmes Registration',
'page callback' => 'drupal_get_form',
'page arguments' => array('form_test_form'),
'access callback' => 'user_access',
'access arguments' => array('Teaching')
);
return $items;
}
My code is not working.