2016-03-07 82 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');