Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Set up a new permission for tabs.
- * Grant access under admin -> user management -> permissions
- */
- function mymodule_permission() {
- return array(
- 'view hidden tabs' => array(
- 'title' => t('Node tabs visibility'),
- 'description' => t('Grant access to node tabs.'),
- ),
- );
- }
- /**
- * Implementation of hook_menu_alter().
- * Show/hide tabs according to permission settings.
- */
- function mymodule_menu_alter(&$items) {
- $items['node/%node/edit']['access callback'] = 'user_access';
- $items['node/%node/edit']['access arguments'] = array('view hidden tabs');
- }
- function mymodule_menu_alter(&$items) {
- $items['node/%node/edit']['type'] = MENU_CALLBACK;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement