2016-03-07 79 views
0

我有這個模塊,作爲管理員用戶,我可以正常訪問此模塊。但是,當我向其他角色(並保存)添加權限時,其他擁有權限的用戶將無法訪問它。請幫幫我。Drupal 6:在自定義模塊上拒絕訪問

下面是代碼:

<?php 
include_once(drupal_get_path('module', 'tb') .'/tb.menu.inc'); 
include_once(drupal_get_path('module', 'tb') .'/tb.inc'); 

function tb_perm() { 
    global $user; 
    return array('trial_balance'); 
} 

function tb_menu() { 
    global $user; 
    $items = array(); 

    $items['akuntansi/tb'] = array(
    'title' => 'Trial Balance', 
    'type' => MENU_NORMAL_ITEM, 
    'page callback' => 'tb_neracapage', 
    'file' => 'tb.inc', 
    'access arguments' => array('akuntansi'), 
    'access callback' => TRUE, 
    //'type' => MENU_CALLBACK, 
); 

    $items['akuntansi/tb/pdf'] = array(
    'page callback' => 'tb_neracapage_pdf', 
    'file' => 'tb.inc', 
    'access arguments' => array('akuntansi'), 
    'type' => MENU_CALLBACK, 
); 
$items['akuntansi/tb/xls'] = array(
    'page callback' => 'tb_neracapage_xls', 
    'file' => 'tb.inc', 
    'access arguments' => array('akuntansi'), 
    'type' => MENU_CALLBACK, 
); 

    return $items; 
} 

?> 

回答

0

問題是這裏:

返回陣列( 'trial_balance');

我應該是:

返回陣列( 'akuntansi');