Drupal 6 example hook_perm()

function mcv_book_perm() {
return array(
‘customer book list’, // permission separated by comma
‘customer add item to book’,
‘customer view book list’,
);
}

function mcv_book_menu(){
$items[‘customer/books’] = array(
‘page callback’ => ‘get_customer_books’,
‘access callback’ => ‘user_access’,  //set access for permission
‘access arguments’ => array(‘customer book list’),  //set permission
‘type’ => MENU_CALLBACK,
);

Now  you are able to see these permissions in permissions list.

Advertisements