The sting in user_access is not the same as in anon_comment_permission().

     '#title' => t('Post this comment anonymously'),
     '#default_value' => 0,
     '#weight' => '10',
-    '#access' => user_access('comment anonymously when logged in')
+    '#access' => user_access('comment anonymously')

Comments

pravin ajaaz’s picture

Status: Active » Postponed (maintainer needs more info)

I believe the key of the permission is 'comment anonymously' and it is rightly used to check the permission

pravin ajaaz’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)