Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.12
-
Fix Version/s: 4.7.14
-
Component/s: Core CiviCRM
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
If you look at the CRM_Contact_BAO_Contact_Permission you'll see that if we want to check individual permissions we only have the ::allow() method which we would have to call for each contact individually - and this call is actually quite expensive.
In a context like PR-9193 this would mean 50+ calls and a serious performance problem.
Therefore I did the following (after talking to Eileen McNaughton in the Edale sprint):
- I created a method ::allowList() that can batch process contact_ids for permissions
- I added the respective unit tests
- By doing that I found and fixed two bugs in the original code