Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/comment/src/CommentFieldItemList.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
48 // status field. | 48 // status field. |
49 $result = AccessResult::allowedIfHasPermission($account ?: \Drupal::currentUser(), 'administer comments'); | 49 $result = AccessResult::allowedIfHasPermission($account ?: \Drupal::currentUser(), 'administer comments'); |
50 return $return_as_object ? $result : $result->isAllowed(); | 50 return $return_as_object ? $result : $result->isAllowed(); |
51 } | 51 } |
52 if ($operation === 'view') { | 52 if ($operation === 'view') { |
53 // Only users with either post comments or access comments permisison can | 53 // Only users with "post comments" or "access comments" permission can |
54 // view the field value. The formatter, | 54 // view the field value. The formatter, |
55 // Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter, | 55 // Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter, |
56 // takes care of showing the thread and form based on individual | 56 // takes care of showing the thread and form based on individual |
57 // permissions, so if a user only has ‘post comments’ access, only the | 57 // permissions, so if a user only has ‘post comments’ access, only the |
58 // form will be shown and not the comments. | 58 // form will be shown and not the comments. |