Fix CRM_ACL_API::whereClause to respect $contactId param #12576
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fixes an edge-case bug in contact permission checks and adds more robust support to the CMS-based permission checking.
Before
The
CRM_ACL_API::whereClause()
function did not correctly handle the$contactID
parameter. It would always check user permissions based on the current user, ignoring that param.After
It correctly checks permissions against the specified user.
Technical Details
This fix required a patch to all 6 CMS integration points (D6, D7, D8, BD, J!, WP). They all handle checking permissions slightly differently and none of it is covered by unit tests (nor do I think it could be with our current test infrastructure). So this will require a fair amount of manual testing.
Notes
I discovered this bug while working on this issue: Load case to webform with contactID, checksum and caseID in the URL