2011-07-27 13 views
0

任何人有任何想法?Drupal 6 - 检索可以编辑节点x的用户列表,或只需获取节点x上的用户y的权限

我一点点坚持,努力使动作运行任意PHP在最新修订的发布执行。我想要做的是获取用户列表以通知有关更改,特别是有权编辑所述节点的用户。

现在我得到了$object返回我的节点ID,所以我很好,我可以得到一个用户列表,很容易循环查看权限。困难的一点是权限检查本身。我试过的东西似乎无法为用户y提供节点x上的“发布”或“更新”权限。

我正在使用nodeaccess模块​​给个别用户访问特定节点顺便说一句,只是为了好玩。

回答

0

如果其他人与此斗争,这就是我所做的。

//whichever nid goes in here, I put in a number to make this easy to read and understand. 
$node_obj=node_load(598); 
//$result_object contains the 'users' table with uid 
while ($result_object=db_fetch_object($result)) 
{ 

    $this_user=$result_object->uid; 
    $this_user_object=user_load($this_user); 
    $access=node_access('update', $node_obj, $this_user_object); 
    if ($access==1) 
    { 
    //mail the user or do whatever 
    } 
} 
相关问题