0

有人有什么想法吗?

我有点卡住了,试图让一个动作运行任意 php 以在最新版本发布时执行。我要做的是获取用户列表以通知更改,特别是有权编辑所述节点的用户。

现在我已经$object返回了我的节点 ID,所以我在那里很好,我可以很容易地获得一个用户列表,以便循环浏览它们并检查权限。困难的是权限检查本身。我尝试过的任何事情似乎都无法在节点 x 上为用户 y 提供“发布”或“更新”权限。

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

4

1 回答 1

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
   }
}
于 2011-08-02T13:54:07.550 回答