Data not displayed in Drupal Views without CiviCRM All Contacts permission

Created on 20 October 2023, about 1 year ago
Updated 13 November 2023, about 1 year ago

Problem/Motivation

I am trying to recreate a Drupal 7 View in Drupal 9/10.

The View is based on a list of CiviCRM Cases with related data.

Data is not displaying for users that do not have the Drupal permission of 'CiviCRM: View All contacts'.

More details in this CiviStack question:
Drupal 9/10 Views requires 'View All Contact' permission

Steps to reproduce

  1. Create a CiviCRM Security Group and add a few users
  2. Create an ACL Role and add the above users to this
  3. Create a new ACL that gives the ACL Role the rights to Edit another group of contacts and some custom fields related to the case
  4. Create a Drupal View that outputs the a list of cases with some related data where the clients or related data is covered by the ACL rules
  5. Look at the View as a contact that has the Drupal permission CiviCRM: view all contacts View ANY CONTACT in the CiviCRM database - the display name is output
  6. Look at the View as a contact that does not have the Drupal permission CiviCRM: view all contacts View ANY CONTACT in the CiviCRM database - the display name is blank

In Drupal 7, as long as the logged in user has the rights to View or Edit a group of contacts, Any Drupal View that outputs data for these group of contacts is displayed. This is not the case in Drupal 9.5x (using 8.x-3.5) or 10 (using 4.0.0-alpha6)

πŸ› Bug report
Status

Active

Version

4.0

Component

CiviCRM Entity Views Extras

Created by

πŸ‡¬πŸ‡§United Kingdom chumkui

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

Comments & Activities

  • Issue created by @chumkui
  • πŸ‡ΊπŸ‡ΈUnited States markusa

    Views of contacts should not require 'view all contacts'.

    For my information are you rendering an display of the contact entity, or do you only have fields on the View.

    Can you provide the the configuration export for the View?

    Some of the ways this could work could be a matter of opinion on bug vs. feature, but I want to make sure I undesrstand your case most clearly.

    ALso, there is a contributed PR that we chose not to merge, but maybe helps you, and maybe we re-consider it.
    https://github.com/eileenmcnaughton/civicrm_entity/pull/262

  • πŸ‡¬πŸ‡§United Kingdom chumkui

    Hi Mark

    Many thanks. Here is a gist of the View's config. I duplicated the original and made it as simple as possible, taking out all the other stuff that is not applicable to the issue. There are just the two contact fields that do not display.

    Gist of View export

  • πŸ‡¬πŸ‡§United Kingdom chumkui
  • πŸ‡¬πŸ‡§United Kingdom chumkui

    Hi Mark

    I have just created the most simple of Views that just displays the same list of contacts. This View works fine, which must mean that it is the relationship to CiviCases that may be the issue. The View that has the issue has a base table of CiviCRM cases displays a list of case clients (amongst other details). Not sure if this helps, but it clearly is not just a plain Contact Entiry issue, as you rightly say, this works OK in isolation

  • πŸ‡¬πŸ‡§United Kingdom chumkui

    Updating the original question as this relates to Views that have a base table of CiviCRM Cases

  • πŸ‡¬πŸ‡§United Kingdom chumkui
Production build 0.71.5 2024