Last active
June 15, 2016 17:00
-
-
Save stefanruijsenaars/e890de21949d1d21b86ed937d190a4ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -u b/core/modules/comment/src/CommentFieldItemList.php b/core/modules/comment/src/CommentFieldItemList.php | |
--- b/core/modules/comment/src/CommentFieldItemList.php | |
+++ b/core/modules/comment/src/CommentFieldItemList.php | |
@@ -51,8 +51,11 @@ | |
} | |
if ($operation === 'view') { | |
// Only users with either post comments or access comments permisison can | |
- // view the field value. The formatter takes care of showing the comment | |
- // thread and form based on the individual permissions. | |
+ // view the field value. The formatter, | |
+ // Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter, | |
+ // takes care of showing the thread and form based on individual | |
+ // permissions, so if a user only has ‘post comments’ access, only the | |
+ // form will be shown and not the comments. | |
$result = AccessResult::allowedIfHasPermission($account ?: \Drupal::currentUser(), 'access comments') | |
->orIf(AccessResult::allowedIfHasPermission($account ?: \Drupal::currentUser(), 'post comments')); | |
return $return_as_object ? $result : $result->isAllowed(); | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment