Restrict comments on nodes of a content type based on user role I am building a site in Drupal, where there are 2 different types of registered users. Let us call them basic users and premium users. These could be roles, or groups, or something else.

Authorized users will be able to publish pages with simple content and comments underneath. All pages are viewable publicly, even by non registered users and so are the comments.

Only registered users should be able to post comments.

What I would like is for some pages to allow comments only from premium users. So, there would be two categories of pages. Again let us call them basic pages and premium pages.

The permissions would be as follows:

Basic pages
READ: all
COMMENT: basic users, premium users

Premium pages
READ: all
COMMENT: premium users

Any help/pointers would be appreciated, as I have limited experience with Drupal.
You can perform a hook_form_alter on the comment form in a custom module. This will allow you to change the form so it checks if the current user has a premium role. If the acting user has the premium role the option to submit a comment is displayed. If they do not show a message like "only premium members can comment".

MODULENAME_form_alter(&amp;$form, &amp;$form_state, $form_id) {
if ( $form_id == 'comment_form') {
  global $user;
   if (!user_role('Premium'){
    // Form alter here to unset comment form and show "only premium members can comment"
    unset($form['author']); 
    unset($form['subject']); 
    unset($form['comment_body']);
    unset($form['actions']['submit'] );
    unset($form['actions']['preview'] );
    print "Only Premium members can comment";
  } 
 }
};


You can look in comment.module for the default code for comments....