Drupal 6.x钩多个内容类型
我有这个模块管理四种不同的内容类型。对于这个问题,我如何为同一模块中的每个内容定义权限?这甚至有可能吗?我不知道如何定义每种内容类型的权限cuz hook_perm必须用模块名称命名,并且它没有任何参数(如hook_access $ node)以基于内容类型返回许可。这是我想怎么做 -
function mymodule_perm()
{
if(content1)
return array(
'create content1 node',
'edit content1 nodes',
'delete content1 nodes',
);
if(content2)
return array(
'create content2 node',
'edit content2 nodes',
'delete content2 nodes',
);
if(content3)
return array(
'create content3 node',
'edit content3 nodes',
'delete content3 nodes',
);
.......
}
任何帮助将不胜感激。
我是如何错过每个内容的权限字符串可以作为整个字符串返回!谢谢一堆。 – Andrew 2010-06-12 14:15:55