如何授予特定用户对特定节点的编辑权限?
如何授予特定用户对特定节点的编辑权限?
我有一个名为“学生”的用户角色。多个用户具有该角色,但只有少数用户可以编辑节点。我怎样才能意识到这一点?
How do I give a specific user editing rights to a specific node?
I have a user role named "Student". Multiple users have that role, only a few of them can edit a node. How can I realise this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我将尝试介绍一些用例,以及如何解决它们:
这些都假设您的内容没有分类。如果您的内容和用户组织得足够好,您也许能够利用基于分类法或有机组的节点访问模块。
I'll try and cover a few use cases, with how I would solve them:
These all assume there is no categorization for your content. You may be able to utilize node access modules based on Taxonomy or Organic Groups if your content and users are organized sufficiently.
对于像这样的异常权限问题,我总是发现一个小的自定义模块是可行的方法。通用节点访问模块必须足够通用才能适用于许多不同的情况,这通常使它们有点混乱和混乱。
对于这个特定的,您可以创建一个实现 hook_nodeapi 的模块,并在 $op==prepare 上,根据您的用户引用检查用户的 ID,如果不匹配,则执行 drupal_goto 访问拒绝页面。
For sort of abnormal permissions stuff like this, I've always found that a small custom module is the way to go. General node access modules have to be general enough to be useful for a lot of different cases, which generally makes them sort of messy and confusing.
For this specific one, you could create a module that implements hook_nodeapi and on $op==prepare, check the user's ID against your user reference and do a drupal_goto the access denied page if they don't match up.
您可以使用 Flexi Access 来完成此操作。授予特定用户节点上的“更新”权限将允许他编辑该节点。
有关更多选项,请参阅页面:节点访问模块概述 @ Drupal.org。
You can do this with Flexi Access. Giving a specific user the "update" privilege on a node will allow him to edit the node.
For more options, see the page: Overview of Node Access modules @ Drupal.org.
您是否尝试过节点访问或内容访问?
Have you tried either Node Access or Content Access?
如果只有一个子集能够编辑节点,则您需要一个额外的“超级学生”角色。
节点访问模块可以帮助您在节点上设置适当的权限。以下是其项目页面的摘录:
If only a subset should be able to edit nodes, you need an additional "super student" role.
The Node Access module may help you set appropriate permissions on the nodes. Here is an excerpt from its project page: