Neutral permission is returned while viewing group content instead of returning Allowed permission

Created on 31 December 2018, over 5 years ago
Updated 15 March 2023, over 1 year ago

Problem/Motivation

When viewing a group content, viewAccess() method in GroupContentEnablerBase.php returns Neutral access instead of Allowed. This results in access denied.

Proposed resolution

viewAccess() method has the following statement:

return GroupAccessResult::allowedIfHasGroupPermission($group, $account, "view $plugin_id content");

On comparing with the permissions, it seems that all the permissions end with "entity" instead of "content". Changing the word "content" to "entity" should fix this issue. Here's a screenshot of the permissions array and the individual permission that's to be checked.

πŸ› Bug report
Status

Needs review

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States jcmartinez Raleigh, NC, USA

    I was trying to upgrade a site to Drupal 10 and wanted to use the latest:

    composer require 'drupal/group:^3.0@RC'
    composer require 'drupal/group:^2.0@RC'

    I found that this patch can't be applied to neither of these versions. I don't know if the issue is still present in 3.0@RC'
    and 2.0@RC'.

    This shouldn't be a blocker for upgrading to D10 because the version 8.x-1.5 Stable shows that Works with Drupal: ^9.3 || ^10

    I thought that I should note this here.

  • πŸ‡ΊπŸ‡ΈUnited States dww

    The 8.x-1.c branch does not work with D10. It’s all lies. πŸ˜‰
    See πŸ› Fix core_version_requirements in 8.x-1.x branch to match reality Closed: outdated

Production build 0.69.0 2024