如何控制drupal 6.X中的节点/内容访问?
我在 drupal 6 中创建了一个站点。它的所有内容都作为页面节点放置。我创建了一个具有编辑者角色的用户,并授予以下
访问内容的 权限 管理内容类型 管理员节点 编辑任何页面内容 编辑自己的页面内容
我希望该用户仅编辑内容页面已经由其他用户创建 不想移除/删除内容/节点< /em> 来自网站。
我该怎么办呢。我尝试了
nodeaccess-6.x-1.3.zip node_privacy_byrole-6.x-1.6.zip
也尝试了 content_access-6.x-1.2.zip(但没有找到此模块的任何设置?)。请帮我解决这个问题。
提前致谢。
步骤1.
I had a site created in drupal 6. All its contents are placed as Page Nodes. I created a user with editor role and given following permissions
access content
administer content types
adminsiter node
edit any page content
edit own page content
I want this user to only edit the content pages already created by another user do not want to remove/delete content/node from the site.
How can I do this. I tried
nodeaccess-6.x-1.3.zip
node_privacy_byrole-6.x-1.6.zip
also tried content_access-6.x-1.2.zip(but not find any settings for this module ?). Please help me to solve this issue.
thanks in advance.
Step1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我不知道是否有一个模块支持在节点删除上添加权限,但请尝试以下操作......
首先我们需要创建一个模块(不用担心很容易)来生成您可以授予任何用户角色的新权限,我们将此权限称为“节点删除权限”
1-转到/sites/all/modules
2- 创建一个名为“node_delete_permission”的新文件夹并在该文件夹中创建文件
具有以下名称“node_delete_permission.info”&& “node_delete_permission.module”
3-打开node_delete_permission.info并在其中添加以下内容:
4-现在打开node_delete_permission.module并在其中添加以下代码
<前><代码>
5-现在从(admin/build/modules)启用您的新模块并转到(/admin/user/permissions)..确保您生成了一个名为“节点删除权限”的新权限
如果没问题...让我们进入下一步
6-转到您的主题“page.tpl.php”并在此文件的顶部添加以下代码
<前><代码> TRUE)) ;
if(arg(0) == '节点' && arg(2) == '删除' &&& !user_access('节点删除权限')){
drupal_set_message('
') ;
header("位置:{$node_path}") ;
}
?>
,现在您可以将此权限授予您想要的任何用户角色(/admin/user/permissions)
注意:
1-它不是 100% 的 drupal 方式,但我认为它在你的情况下很有用
你可以回复我
2-我没有测试这段代码,所以你可能会发现语法错误或其他东西...如果你发现这个3-我有, 我英语不好我知道并且对此感到抱歉
ok i don't know if there is a modules that support adding permissions on node delete or not but try the following.....
first we need to create a module (don't worry ist easy) that generate a new permission which you can give to any users role lets call this permission "node delete permission"
1- go to /sites/all/modules
2- create a new folder with name "node_delete_permission" and create files inside this folder
with the following names "node_delete_permission.info" && "node_delete_permission.module"
3- open node_delete_permission.info and add the following inside it :
4- now open node_delete_permission.module and add the following code inside it
5- now enable your new module from (admin/build/modules) and go to (/admin/user/permissions) .. make sure that you have a new permission generated called "node delete permission"
if its ok...lets go to the next step
6- go to you theme "page.tpl.php" and add the following code at the top of the this file
now you can give this permission to any user role you want from (/admin/user/permissions)
NOTE:
1- its not 100% the drupal way but i think its useful in ur case
2- i didn't test this code so you may found a syntax error or something...you can get back to me if you found this
3- i hav a bad english i know and im sorry for this
启用 CCK 附带的内容权限模块,应该可以让您控制可以查看、创建、编辑或删除页面内容类型中的哪些字段
Enabling the content permissions module that ships with CCK , should give you control over which field in the Page content type can be viewed , created, edited or deleted