开发者

Drupal Private Publishing

开发者 https://www.devze.com 2022-12-31 09:39 出处:网络
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 esca开发者_高级运维ping me.Try th

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 esca开发者_高级运维ping me.


Try the Nodeaccess module. Some more details about this module (from its project page):

Nodeaccess is a Drupal access control module which provides view, edit and delete access to nodes. Users with the 'grant node permissions' permission will have a grant tab on node pages which allows them to grant access to that node by user or role. Administrators can set default access controls per content type, and also define which roles are available to grant permissions to on the node grants tab.

The upshot is, this module allows you to do things like 'node 123 can be viewed by authenticated users and edited by admin users and joeuser'. As an added bonus, update and delete permissions are separated, so you can make sure users with edit permissions cannot accidentally delete pages.


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 to hook_nodeapi, but unfortunately that's a hack to the core Drupal code, with all the potential upgrade pitfalls that ensue.

0

精彩评论

暂无评论...
验证码 换一张
取 消