0

I am developing a Drupal 7 module. I have created a table in the drupal database for that module directly in phpMyAdmin. I have set te permissions for that module to be viewed by authenticated users. The module works fine when I log in as an administrator. But it gives "access denied" when I log in as the authenticated user.

Anyone any suggestions how I can also give authenticated users access? Thanks!

4

2 回答 2

2

可能问题出在菜单挂钩上。请检查其访问参数。

它应该是这样的:

  $items['abc-url'] = array(
    'title' => 'Page abc',
    'page callback' => 'page_abc',
    'type' => MENU_CALLBACK,
    'access arguments' => array('access abc'),
    'file' => 'my_module.admin.inc',
  );

然后你需要定义它(在 Drupal 7 中,如下所示):

function my_module_permission() {
  return array(
    'access abc' => array(
      'title' => t('Access abc'),
      'description' => t('This will provide permission to abc.'),
    ),
  );
}

然后清除缓存,转到用户权限页面并授予经过身份验证的用户权限以“访问 abc”。

希望这会有所帮助。

于 2013-07-07T19:25:38.877 回答
0

您需要将用户列表添加到要允许访问的数据库权限属性。

检查此链接。 MySQL:授予对数据库的**所有**权限

于 2013-07-07T08:04:47.357 回答