LatestRevisionCheck: Check group access when there is no pending revision

Created on 12 October 2023, almost 2 years ago

Problem/Motivation

The \Drupal\gcontent_moderation\Access\LatestRevisionCheck checks "view latest" permissions for all related group content for the node when there is no pending revision. The inner service \Drupal\content_moderation\Access\LatestRevisionCheck check if there is a pending revision. If there is not a pending revision then it returns AccessResult::forbidden(). The \Drupal\gcontent_moderation\Access\LatestRevisionCheck will continue to check all groups even though ultimately the access check will be forbidden. All of the AccessResult::orIf() checks will result in Forbidden since the inner service's result is Forbidden.

Proposed resolution

Add a check for !$access->isForbidden().

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States recrit

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024