As you may already know, you can control the comments module behavior with user permissions and with per node-type settings. But what if you want to change the node comments access on the fly?
The problem:
On some nodes i want to disable the comment form for current user, but show him the comments. It is possible with the default comment settings of this node type or with access permissions. But what if the permissions are configured for full read-write access for the current type of node and current user have permission to post comments?
Solution:
No normal solution for the moment. The blocker is comment_render() function which is not granular enough for checking for changed permissions on the fly. There are temporary solutions with templating system which requiring overriding default box.tpl.php and checking for the access in this template (it is very ugly, because the point of templates is to separate site logic from display) and overriding default comment callbacks in comment/reply/%nid menu item with hook_menu_alter().
The point of this post? There are a lot of small common things which are very hard to implement using current state of some core modules. Hope that Drupal 7 will fix that.









No comments
Post new comment