如何为特定节点提供特定用户编辑权限?
我有一个名为"Student"的用户角色.多个用户具有该角色,其中只有少数用户可以编辑节点.我怎么能意识到这一点?
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',
);
.......
}
Run Code Online (Sandbox Code Playgroud)
任何帮助将受到高度赞赏.