-
-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix hasPermissionForActivityType to use components function.
This is a refactor step - not the final destination. I want to move from loading all activities & then checking if each one can be accessed to determining a list of activity types and then adding that filter to the sql query. 2 reasons - performance - because getcount actually hard fails when permissions are applied currently :-( In this step I note the function activityComponents looks like it expected the concept of showActivitiesInCore by components to take off but in practice it is hard coded to 0 for CiviCase & CiviCase only. Oddly there is acually handling for CiviCase in this function in a place unreachable without the changes in this patch. In addition the few places that call this function also do weird CiviCase handling. I've opted for relatively low intervention since I think most places that call this function are likely to change themselves in the short-medium term. note this implements https://lab.civicrm.org/dev/core/issues/454 which slightly downgrades the relevant permission
- Loading branch information
1 parent
12e4974
commit c4937fe
Showing
2 changed files
with
36 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters