--- vud_comment.module.orig	2010-03-17 15:51:00.000000000 +0300
+++ vud_comment.module	2010-03-18 22:31:08.000000000 +0300
@@ -10,7 +10,7 @@
  * Implementation of hook_perm().
  */
 function vud_comment_perm() {
-  return array('administer vote up/down on comments', 'use vote up/down on comments');
+  return array('administer vote up/down on comments', 'use vote up/down on comments', 'view vote up/down count on comments');
 }
 
 /**
@@ -70,14 +70,30 @@
  * Implementation of hook_comment().
  */
 function vud_comment_comment(&$comment, $op) {
+  static $js_added;
   switch ($op) {
     case 'view':
       $type = _vud_comment_get_node_type($comment->nid);
       $comment_allow = in_array($type, variable_get('vud_comment_node_types', array()), TRUE);
-      if ($comment_allow && user_access('use vote up/down on comments')) {
+      if ($comment_allow && (($can_edit = user_access('use vote up/down on comments')) || user_access('view vote up/down count on comments'))) {
         $tag = variable_get('vud_tag', 'vote');
         $widget = variable_get('vud_comment_widget', 'plain');
-        $comment->comment = theme('vud_widget', $comment->cid, 'comment', $tag, $widget) . $comment->comment;
+        $comment->comment = theme('vud_widget', $comment->cid, 'comment', $tag, $widget, !$can_edit) . $comment->comment;
+
+        if (!$js_added) {
+          $widget_message = t('Sorry, there was problem on the vote.');
+          if (!$can_edit) {
+            $widget_message = t('You are not allowed to vote.');
+          }
+          drupal_add_js(
+            array(
+              /* We say vud_node here because this is hardcoded by vud.js */
+              'vud_node' => array('widget_message' => $widget_message),
+            ),
+            'setting'
+          );
+          $js_added = TRUE;
+        }
       }
       break;
   }
@@ -117,7 +133,8 @@
       $votes_display_mode = variable_get('vud_comment_votes', 1);
       $widget_theme = variable_get('vud_comment_widget', 'plain');
       $tag = variable_get('vud_tag', 'vote');
-      if ($votes_display_mode) {
+      $view_vud_comment_votes_count = user_access('view vote up/down count on comments') || user_access('use vote up/down on comments');
+      if ($votes_display_mode && $view_vud_comment_votes_count) {
         $links['vud_comment_votes_count'] = array(
           'title' => theme('vud_votes', $comment->cid, $type, $tag, $widget_theme),
           'html' => TRUE,
