0

I have a Drupal 7 Views that produces a case activities report. It has columns like scheduled activity date, contact id, notes, etc. The user can search by contact id and all activities related to that contact id appears. From this post, this is because CiviCRM Entity does not respect CiviCRM's ACL permission.

I want to see if it's possible to restrict the case activities that only show up if the user has an existing group relationship to the case records. I think I'm close. I have the Group ID as a relationship (access control: clients). I just can't get Views to check the login user's CiviCRM group and validate it against the civicrm ACL.

For example: User A belongs to Group A (staff group). In the ACL, Group A can view contacts from Group B (the clients). When the user uses the case activities report, they should only be able to search contacts to which they have the ACL access from in Group B (not Group C, D, etc.).

The challenge is filtering on the activities on the user login's group ID.

1
  • I don't think i can help more. we have tended to avoid ACLs and use Permissioned Relationships instead, and then that is what controls which contacts the logged in user will see via the views (and in CiviCRM itself).
    – petednz - fuzion
    May 17, 2022 at 20:39

1 Answer 1

0

To have it so the View only shows 'My Cases' you can build the View based on CiviCRM Relationships then use Contextual Filters to filter to get only those relationships that associate to the current user, and then join on the Case.

enter image description here

3
  • I think this is almost there, but I do need the filter to be a group access permission because sometimes supervisors will look up case notes that are both historical and current. The settings above also require a relationship to the case, but supervisors don't need to be a relationship to the case - just the access to view the contact record.
    – Kristine
    May 15, 2022 at 20:28
  • i would do that via 2 different displays then
    – petednz - fuzion
    May 16, 2022 at 0:12
  • Maybe it's not clear. I'll revise the post to clarify that the case access should be based on an existing group relationship.
    – Kristine
    May 17, 2022 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.