Drupal 私人出版
有没有办法让内容类型只有管理员和创建者才能查看,包括评论?我觉得我知道这个问题的答案,但它却逃避了我。
Is there a way to have a content type that is only viewable to admins AND the person who created it, including comments? I feel like I know the answer to this but its escaping me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试 Nodeaccess 模块。有关此模块的更多详细信息(来自其项目页面):
Try the Nodeaccess module. Some more details about this module (from its project page):
如果内容类型是由您自己的模块定义的,您可以使用
hook_access
来执行此操作。如果内容类型是由 CCK 或其他模块定义的,事情会有点棘手。您可以安装补丁,添加一个
access
op tohook_nodeapi
,但不幸的是,这是对核心 Drupal 代码的黑客攻击,随之而来的是所有潜在的升级陷阱。If the content type is defined by your own module, you can use
hook_access
to do this.If the content type is defined by CCK or another module, things are a bit trickier. You can install a patch that adds an
access
op tohook_nodeapi
, but unfortunately that's a hack to the core Drupal code, with all the potential upgrade pitfalls that ensue.